TryGetVariable

Method

TryGetVariable has 2 overloads.

TryGetVariable(byte, out object)

Retrieves the value of a variable on the space object.

Definition

bool TryGetVariable(byte id, out object value)
bool TryGetVariable(byte id, out object value)

Returns bool

Parameters

ParameterDescription
byte id

The id of the variable to retrieve. It is recommended to use an enum of type byte to define variables.

object value

The value of the variable if it exists.

TryGetVariable<T>(byte, out T)

Retrieves the value of a variable on the space object.

Definition

bool TryGetVariable<T>(byte id, out T value)
bool TryGetVariable<T>(byte id, out T value)

Returns bool

Parameters

ParameterDescription
byte id

The id of the variable to retrieve. It is recommended to use an enum of type byte to define variables.

T value

The value of the variable if it exists casted to the desired type.