ComponentId

ComponentId Struct

Encapsulates a Component Id.

Syntax

public struct ComponentId

Remarks

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

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

Members

See Also: Inherited members from ValueType.

Public Fields

static readonly
Invalid ComponentId . The invalid id object.

Public Properties

[read-only]
 
ObjectId ObjectId . Retrieves the Sansar.Script.ObjectId associated with this ComponentId.

Public Methods

override
Equals (object) : bool
Value comparison for ComponentId.
override
GetHashCode () : int
Retrieves the hash code for this instance.
override
ToString () : string
Converts the id to a hexadecimal string representation.

Public Operators

static
Equality (ComponentIdComponentId) ComponentId equality operator.
static
Inequality (ComponentIdComponentId) ComponentId inequality operator.
static
Conversion to Sansar.Script.ComponentId (Implicit) Internal explicit conversion from a ulong.

Member Details

Equals Method

Value comparison for ComponentId.

Syntax

public override bool Equals (object obj)

Parameters

obj
The object to compare.

Returns

true if the argument is a ComponentId and has the same value.

Remarks

This method overrides ValueType.Equals.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

GetHashCode Method

Retrieves the hash code for this instance.

Syntax

public override int GetHashCode ()

Returns

The hash code for this instance.

Remarks

This method overrides ValueType.GetHashCode.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

Invalid Field

The invalid id object.

Syntax

public static readonly ComponentId Invalid

Remarks

This value is used by certain APIs to represent an invalid ComponentId.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

ObjectId Property

Retrieves the Sansar.Script.ObjectId associated with this ComponentId.

Syntax

public ObjectId ObjectId { get; }

Value

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.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

op_Equality Method

ComponentId equality operator.

Syntax

public static bool operator== (ComponentId a, ComponentId b)

Parameters

a
First ComponentId to compare.
b
Second ComponentId to compare.

Returns

true if the ComponentIds have the same value.

Remarks

This is a value comparison.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

Conversion Method

Internal explicit conversion from a ulong.

Syntax

public static implicit operator ComponentId (ulong id)

Parameters

id
A ulong representation of an ComponentId

Returns

A new ComponentId initialized with the given ulong.

Remarks

Internal.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

op_Inequality Method

ComponentId inequality operator.

Syntax

public static bool operator!= (ComponentId a, ComponentId b)

Parameters

a
First ComponentId to compare.
b
Second ComponentId to compare.

Returns

true if the ComponentIds have a different value.

Remarks

This is a value comparison.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

ToString Method

Converts the id to a hexadecimal string representation.

Syntax

public override string ToString ()

Returns

The hexadecimal string representation.

Remarks

This method overrides object.ToString.

Requirements

Namespace: Sansar.Script
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0


 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.