Struct Value¶
Namespace: Apogee.Reflection
Assembly: Apogee.Reflection.dll
A value that crosses between the engine and scripts: no boxing for numbers, vectors, entities and enums. The To…
methods check the kind and throw a
public readonly struct Value : IEquatable<Value>
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
EnumType¶
The enum a
public EnumInfo EnumType { get; }
Property Value¶
IsNil¶
public bool IsNil { get; }
Property Value¶
Kind¶
public ValueKind Kind { get; }
Property Value¶
Methods¶
Bool(bool)¶
public static Value Bool(bool value)
Parameters¶
value bool
Returns¶
Entity(Entity)¶
public static Value Entity(Entity value)
Parameters¶
value Entity
Returns¶
Enum(EnumInfo, long)¶
public static Value Enum(EnumInfo type, long value)
Parameters¶
type EnumInfo
value long
Returns¶
Equals(Value)¶
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Value other)
Parameters¶
other Value
An object to compare with this object.
Returns¶
true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)¶
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters¶
obj object?
The object to compare with the current instance.
Returns¶
true if obj and this instance are the same type and represent the same value; otherwise, false.
Float(double)¶
public static Value Float(double value)
Parameters¶
value double
Returns¶
Function(ScriptFunction?)¶
public static Value Function(ScriptFunction? value)
Parameters¶
value ScriptFunction?
Returns¶
GetHashCode()¶
Returns the hash code for this instance.
public override int GetHashCode()
Returns¶
A 32-bit signed integer that is the hash code for this instance.
Int(long)¶
public static Value Int(long value)
Parameters¶
value long
Returns¶
List(IReadOnlyList<Value>?)¶
public static Value List(IReadOnlyList<Value>? items)
Parameters¶
items IReadOnlyList<Value>?
Returns¶
ListOf<T>(IEnumerable<T>?, Func<T, Value>)¶
public static Value ListOf<T>(IEnumerable<T>? items, Func<T, Value> convert)
Parameters¶
items IEnumerable<T>?
Returns¶
Type Parameters¶
T
Object(EngineObject?)¶
An object; null is nil.
public static Value Object(EngineObject? value)
Parameters¶
value EngineObject?
Returns¶
Quat(Quaternion)¶
public static Value Quat(Quaternion value)
Parameters¶
value Quaternion
Returns¶
String(string?)¶
A string; null is nil.
public static Value String(string? value)
Parameters¶
value string?
Returns¶
Table(ScriptTable?)¶
A table kept by reference; null is nil.
public static Value Table(ScriptTable? value)
Parameters¶
value ScriptTable?
Returns¶
ToAssetRef()¶
The text of a string value read as an asset reference (path, path|uid://… or uid://…); what the generated setters of
public AssetRef ToAssetRef()
Returns¶
ToBool()¶
public bool ToBool()
Returns¶
ToByte()¶
public byte ToByte()
Returns¶
ToDouble()¶
public double ToDouble()
Returns¶
ToEntity()¶
public Entity ToEntity()
Returns¶
ToEnum()¶
The numeric value of an enum member.
public long ToEnum()
Returns¶
ToFunction()¶
public ScriptFunction ToFunction()
Returns¶
ToInt16()¶
public short ToInt16()
Returns¶
ToInt32()¶
public int ToInt32()
Returns¶
ToInt64()¶
An integer; a float with no fraction is accepted (scripts only have doubles).
public long ToInt64()
Returns¶
ToList()¶
public IReadOnlyList<Value> ToList()
Returns¶
ToListOf<T>(Func<Value, T>)¶
public List<T> ToListOf<T>(Func<Value, T> convert)
Parameters¶
Returns¶
List<T>
Type Parameters¶
T
ToObject<T>()¶
The object, which must be a T and alive.
public T ToObject<T>() where T : EngineObject
Returns¶
T
Type Parameters¶
T
ToQuaternion()¶
public Quaternion ToQuaternion()
Returns¶
ToSByte()¶
public sbyte ToSByte()
Returns¶
ToSingle()¶
public float ToSingle()
Returns¶
ToString()¶
Returns the fully qualified type name of this instance.
public override string ToString()
Returns¶
The fully qualified type name.
ToStringValue()¶
public string ToStringValue()
Returns¶
ToTable()¶
public ScriptTable ToTable()
Returns¶
ToUInt16()¶
public ushort ToUInt16()
Returns¶
ToUInt32()¶
public uint ToUInt32()
Returns¶
ToUInt64()¶
public ulong ToUInt64()
Returns¶
ToVector3()¶
public Vector3 ToVector3()
Returns¶
Vector(Vector3)¶
public static Value Vector(Vector3 value)
Parameters¶
value Vector3
Returns¶
Operators¶
operator ==(Value, Value)¶
public static bool operator ==(Value left, Value right)
Parameters¶
left Value
right Value
Returns¶
operator !=(Value, Value)¶
public static bool operator !=(Value left, Value right)
Parameters¶
left Value
right Value