Encapsulates a Component Id.
public struct ComponentIdRemarks
The ComponentId is a unique identifier for a component. An ObjectId can be derived from a ComponentId.
Members at a glance
| Kind | Members |
|---|---|
| Fields | Invalid |
| Properties | ObjectId |
| Methods | Equals · GetHashCode · ToString |
| Operators | op_Equality · op_Implicit · op_Inequality |
Fields
Invalid
public static readonly ComponentId InvalidThe invalid id object.
Remarks
This value is used by certain APIs to represent an invalid ComponentId.
Properties
ObjectId
public ObjectId ObjectId { get; }Retrieves the ObjectId associated with this ComponentId.
Value: ObjectId — The is exactly 1 ObjectId associated with each ComponentId.
Remarks
The ObjectId returned will be valid if the ComponentId is valid. An ComponentId.Invalid ComponentId will return ObjectId.Invalid.
Methods
Equals
public override bool Equals(object obj)Value comparison for ComponentId.
| Parameter | Type | Description |
|---|---|---|
obj | object | The object to compare. |
Returns: bool — true if the argument is a ComponentId 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 Object.ToString.
Operators
op_Equality
public static bool operator ==(ComponentId a, ComponentId b)ComponentId equality operator.
| Parameter | Type | Description |
|---|---|---|
a | ComponentId | First ComponentId to compare. |
b | ComponentId | Second ComponentId to compare. |
Returns: bool — true if the ComponentIds have the same value.
Remarks
This is a value comparison.
op_Implicit
public static implicit operator ComponentId(ulong id)Internal explicit conversion from a ulong.
| Parameter | Type | Description |
|---|---|---|
id | ulong | A ulong representation of an ComponentId |
Returns: ComponentId — A new ComponentId initialized with the given ulong.
Remarks
Internal.
op_Inequality
public static bool operator !=(ComponentId a, ComponentId b)ComponentId inequality operator.
| Parameter | Type | Description |
|---|---|---|
a | ComponentId | First ComponentId to compare. |
b | ComponentId | Second ComponentId to compare. |
Returns: bool — true if the ComponentIds have a different value.
Remarks
This is a value comparison.
Used in examples
- RandomMovement.cs
- ObjectScriptExample.cs
- SceneObjectScriptExample.cs
- ScriptLibrary/Quest/QuestObjectInteraction.cs
- ScriptLibrary/Quest/QuestVisibility.cs
- ScriptLibrary/Scene/HintText.cs
- ScriptLibrary/Scene/Interaction.cs
- ScriptLibrary/Scene/PositionReset.cs
- ScriptLibrary/ScriptWatcher.cs
Generated from the Sansar 47.10.0 client ScriptApi snapshot.