Skip to content

Get Sansar

Script API

ScriptId

Where: Client
More page actions

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

Struct Namespace Sansar.Script Inherits IComparable, IComparable<ScriptId>

Encapsulates an Script Id.

public struct ScriptId : IComparable, IComparable<ScriptId>

Remarks

Script Ids are unique per running scene.

Members at a glance

KindMembers
FieldsAllScripts · Invalid
PropertiesIsValid
MethodsCompareTo · Equals · GetHashCode · ToString
Operatorsop_Equality · op_Implicit · op_Inequality

Fields

AllScripts

public static readonly ScriptId AllScripts

The invalid id script.

Remarks

This value is used by certain APIs to represent all scripts.

Invalid

public static readonly ScriptId Invalid

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

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

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

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

ParameterTypeDescription
aScriptIdFirst ScriptId to compare.
bScriptIdSecond 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.

ParameterTypeDescription
idScriptIdThe Script id to convert.

op_Inequality

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

ScriptId inequality operator.

ParameterTypeDescription
aScriptIdFirst ScriptId to compare.
bScriptIdSecond 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.