Encapsulates an Script Id.
public struct ScriptId : IComparable, IComparable<ScriptId>Remarks
Script Ids are unique per running scene.
Members at a glance
| Kind | Members |
|---|---|
| Fields | AllScripts · Invalid |
| Properties | IsValid |
| Methods | CompareTo · Equals · GetHashCode · ToString |
| Operators | op_Equality · op_Implicit · op_Inequality |
Fields
AllScripts
public static readonly ScriptId AllScriptsThe invalid id script.
Remarks
This value is used by certain APIs to represent all scripts.
Invalid
public static readonly ScriptId InvalidThe invalid id script.
Remarks
This value is used by certain APIs to represent an invalid ScriptId.
Properties
IsValid
public bool IsValid { get; }Gets the valid state for this ScriptId.
Value: bool — True if this id is a valid ScriptId.
Methods
CompareTo
public int CompareTo(ScriptId other)Compares another instance to this scriptId.
| Parameter | Type | Description |
|---|---|---|
other | ScriptId | The scriptId to compare with this instance. |
Returns: int — Returns -1 if this scriptId comes before the specified instance, 1 if this script id comes after the specified instance, 0 otherwise.
public int CompareTo(object other)Compares another instance to this scriptId.
| Parameter | Type | Description |
|---|---|---|
other | object | The scriptId to compare with this instance. |
Returns: int — Returns -1 if this scriptId comes before the specified instance, 1 if this script id comes after the specified instance, 0 otherwise. Returns 2 if the object is not a scriptId.
Equals
public override bool Equals(object obj)Value comparison for ScriptId.
| Parameter | Type | Description |
|---|---|---|
obj | object | The script to compare. |
Returns: bool — true if the argument is an ScriptId and has the same value.
Remarks
This method overrides ValueType.Equals.
GetHashCode
public override int GetHashCode()Retrieves the hash code for this instance.
Returns: int — The hash code for this instance.
Remarks
This method overrides ValueType.GetHashCode.
ToString
public override string ToString()Converts the id to a hexadecimal string representation.
Returns: string — The hexadecimal string representation.
Remarks
This method overrides Script.ToString.
Operators
op_Equality
public static bool operator ==(ScriptId a, ScriptId b)ScriptId equality operator.
| Parameter | Type | Description |
|---|---|---|
a | ScriptId | First ScriptId to compare. |
b | ScriptId | Second ScriptId to compare. |
Returns: bool — true if the ScriptIds have the same value.
Remarks
This is a value comparison.
op_Implicit
public static implicit operator uint(ScriptId id)Convert a ScriptId to a uint.
| Parameter | Type | Description |
|---|---|---|
id | ScriptId | The Script id to convert. |
op_Inequality
public static bool operator !=(ScriptId a, ScriptId b)ScriptId inequality operator.
| Parameter | Type | Description |
|---|---|---|
a | ScriptId | First ScriptId to compare. |
b | ScriptId | Second ScriptId to compare. |
Returns: bool — true if the ScriptIds have a different value.
Remarks
This is a value comparison.
Used in examples
Generated from the Sansar 47.10.0 client ScriptApi snapshot.