Struct LuauValue
- Namespace
- LuauInterop
- Assembly
- LuauInterop.dll
Represents a raw Luau value.
public readonly struct LuauValue
- Inherited Members
Constructors
LuauValue(LuauType, double, long, object?, LuaState?)
Represents a raw Luau value.
public LuauValue(LuauType type, double number, long integer, object? reference, LuaState? state = null)
Parameters
Properties
Integer
Gets the integer value.
public long Integer { get; }
Property Value
Remarks
Nil
Gets a Luau nil value.
public static LuauValue Nil { get; }
Property Value
Number
Gets the numeric value.
public double Number { get; }
Property Value
Remarks
Reference
Gets the reference-backed value.
public object? Reference { get; }
Property Value
Remarks
Used for strings and other managed reference-backed Luau values.
State
Gets the Lua state associated with this value, if applicable.
public LuaState? State { get; }
Property Value
Remarks
Type
Gets the Luau type of this value.
public LuauType Type { get; }
Property Value
Methods
ToClr()
Converts this value into its managed CLR representation.
public object? ToClr()
Returns
Exceptions
- InvalidOperationException
The value does not contain the expected backing reference.
- NotSupportedException
The value type is not supported for CLR conversion.
ToString()
Returns the string representation of this value.
public override string ToString()
Returns
- string
The CLR string representation of the value, or
"nil"if the value is nil.
Operators
implicit operator LuauValue(bool)
Converts a boolean into a Luau boolean value.
public static implicit operator LuauValue(bool value)
Parameters
valuebool
Returns
implicit operator LuauValue(double)
Converts a double into a Luau number value.
public static implicit operator LuauValue(double value)
Parameters
valuedouble
Returns
implicit operator LuauValue(int)
Converts a 32-bit integer into a Luau number value.
public static implicit operator LuauValue(int value)
Parameters
valueint
Returns
implicit operator LuauValue(long)
Converts a 64-bit integer into a Luau integer value.
public static implicit operator LuauValue(long value)
Parameters
valuelong
Returns
implicit operator LuauValue(string)
Converts a string into a Luau string value.
public static implicit operator LuauValue(string value)
Parameters
valuestring