-
Notifications
You must be signed in to change notification settings - Fork 0
ResourceUid
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.ResourceUid |
| Namespace | Electron2D |
| Kind | class |
| Category | Resources |
Manages stable unique identifiers for resource paths in an Electron2D project.
public static class Electron2D.ResourceUidProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: ResourceUID / ResourceUid
Stable uid:// conversion and in-memory UID-to-path mapping for resource references.
Resource UIDs let scene and resource files keep a stable uid://
reference while a resource is renamed or moved. The path remains available
as a readable fallback for review tools and for projects that do not have a
UID mapping loaded yet.
This class provides Electron2D's resource UID registry using the C# naming shape used by the runtime API. In Electron2D 0.1.0 Preview it is a static runtime facade, not an engine singleton object.
All methods are safe to call from any thread. Methods that read or mutate the UID registry synchronize internally.
This class is available since Electron2D 0.1.0 Preview.
| Member | Kind | Summary |
|---|---|---|
InvalidId |
Field | The value used when a resource UID is invalid or cannot be resolved. |
AddId(System.Int64, System.String) |
Method | Adds a UID mapping for a resource path. |
CreateId() |
Method | Creates a random UID that is not currently registered. |
CreateIdForPath(System.String) |
Method | Creates a deterministic UID candidate for a resource path. |
EnsurePath(System.String) |
Method | Returns a path, converting a uid:// value when needed. |
GetIdPath(System.Int64) |
Method | Gets the path currently associated with a UID. |
HasId(System.Int64) |
Method | Reports whether a UID is registered. |
IdToText(System.Int64) |
Method | Converts a UID value to uid:// text. |
PathToUid(System.String) |
Method | Converts a resource path to UID text when the path is registered. |
RemoveId(System.Int64) |
Method | Removes a registered UID. |
SetId(System.Int64, System.String) |
Method | Updates the path associated with an existing UID. |
TextToId(System.String) |
Method | Extracts a numeric UID from uid:// text. |
UidToPath(System.String) |
Method | Converts UID text to a registered resource path. |
Kind: Field
public const System.Int64 InvalidIdThe value used when a resource UID is invalid or cannot be resolved.
The text form of this value is uid://<invalid>.
This constant is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid
Kind: Method
public static System.Void AddId(System.Int64, System.String)(System.Int64 id, System.String path)Adds a UID mapping for a resource path.
This method follows the validation and lifetime rules of its declaring type.
-
id: The UID value to register. -
path: The resource path associated withid.
-
System.ArgumentException: Thrown whenidis invalid orpathis empty. -
System.InvalidOperationException: Thrown when the UID or path is already registered.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.HasId(System.Int64)Electron2D.ResourceUid.SetId(System.Int64,System.String)
Kind: Method
public static System.Int64 CreateId()()Creates a random UID that is not currently registered.
This method follows the validation and lifetime rules of its declaring type.
A positive UID value that can be registered with Electron2D.ResourceUid.AddId(System.Int64,System.String) or Electron2D.ResourceUid.SetId(System.Int64,System.String).
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid
Kind: Method
public static System.Int64 CreateIdForPath(System.String)(System.String path)Creates a deterministic UID candidate for a resource path.
If the path is already registered, the registered UID is returned. If the deterministic candidate collides with another registered path, the next free positive value is returned.
-
path: The resource path used as the UID seed.
A positive UID value that is stable for path within this runtime contract.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid
Kind: Method
public static System.String EnsurePath(System.String)(System.String pathOrUid)Returns a path, converting a uid:// value when needed.
This method follows the validation and lifetime rules of its declaring type.
-
pathOrUid: A resource path or UID text.
The unchanged path when pathOrUid is not a UID, the
mapped resource path for a known UID, or an empty string for an unknown
or invalid UID.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.UidToPath(System.String)
Kind: Method
public static System.String GetIdPath(System.Int64)(System.Int64 id)Gets the path currently associated with a UID.
This method follows the validation and lifetime rules of its declaring type.
-
id: The UID value to resolve.
The resource path associated with id.
-
System.InvalidOperationException: Thrown when the UID is not registered.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.HasId(System.Int64)
Kind: Method
public static System.Boolean HasId(System.Int64)(System.Int64 id)Reports whether a UID is registered.
This method follows the validation and lifetime rules of its declaring type.
-
id: The UID value to check.
true when id is known; otherwise, false.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid
Kind: Method
public static System.String IdToText(System.Int64)(System.Int64 id)Converts a UID value to uid:// text.
This method follows the validation and lifetime rules of its declaring type.
-
id: The UID value to convert.
A uid:// string for valid positive values, or uid://<invalid> for invalid values.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.TextToId(System.String)
Kind: Method
public static System.String PathToUid(System.String)(System.String path)Converts a resource path to UID text when the path is registered.
This method follows the validation and lifetime rules of its declaring type.
-
path: The resource path to convert.
The registered UID text, or path unchanged when no UID is registered.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.UidToPath(System.String)
Kind: Method
public static System.Void RemoveId(System.Int64)(System.Int64 id)Removes a registered UID.
This method follows the validation and lifetime rules of its declaring type.
-
id: The UID value to remove.
-
System.InvalidOperationException: Thrown when the UID is not registered.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid
Kind: Method
public static System.Void SetId(System.Int64, System.String)(System.Int64 id, System.String path)Updates the path associated with an existing UID.
This method follows the validation and lifetime rules of its declaring type.
-
id: The registered UID value. -
path: The new resource path forid.
-
System.ArgumentException: Thrown whenidis invalid orpathis empty. -
System.InvalidOperationException: Thrown when the UID does not exist or the new path belongs to another UID.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.AddId(System.Int64,System.String)
Kind: Method
public static System.Int64 TextToId(System.String)(System.String textId)Extracts a numeric UID from uid:// text.
This method follows the validation and lifetime rules of its declaring type.
-
textId: The UID text to parse.
The parsed UID, or Electron2D.ResourceUid.InvalidId when the text is not a valid UID.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.IdToText(System.Int64)
Kind: Method
public static System.String UidToPath(System.String)(System.String uid)Converts UID text to a registered resource path.
This method follows the validation and lifetime rules of its declaring type.
-
uid: The UID text to resolve.
The registered resource path, or an empty string when the UID is invalid or unknown.
It is safe to call this method from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ResourceUid.PathToUid(System.String)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.