Skip to content

Get Sansar

Script API

ComponentId

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Struct Namespace Sansar.Script

Encapsulates a Component Id.

public struct ComponentId

Remarks

The ComponentId is a unique identifier for a component. An ObjectId can be derived from a ComponentId.

Members at a glance

KindMembers
FieldsInvalid
PropertiesObjectId
MethodsEquals · GetHashCode · ToString
Operatorsop_Equality · op_Implicit · op_Inequality

Fields

Invalid

public static readonly ComponentId Invalid

The 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.

ParameterTypeDescription
objobjectThe 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.

ParameterTypeDescription
aComponentIdFirst ComponentId to compare.
bComponentIdSecond 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.

ParameterTypeDescription
idulongA 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.

ParameterTypeDescription
aComponentIdFirst ComponentId to compare.
bComponentIdSecond ComponentId to compare.

Returns: bool — true if the ComponentIds have a different value.

Remarks

This is a value comparison.

Used in examples

Generated from the Sansar 47.10.0 client ScriptApi snapshot.