Variant

A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time, instead they are used mainly for communication, editing, serialization and moving data around.

struct Variant {}

Constructors

this
this(Variant other)
Undocumented in source.
this
this(T nil)
Undocumented in source.
this
this(R input)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

DType
alias DType = AliasSeq!(typeof(null), bool, long, double, String, Vector2, Rect2, Vector3, Transform2D, Plane, Quat, AABB, Basis, Transform, Color, NodePath, RID, GodotObject, Dictionary, Array, PoolByteArray, PoolIntArray, PoolRealArray, PoolStringArray, PoolVector2Array, PoolVector3Array, PoolColorArray)

D type that this Variant implementation uses

InternalType
alias InternalType = AliasSeq!(typeof(null), godot_bool, long, double, godot_string, godot_vector2, godot_rect2, godot_vector3, godot_transform2d, godot_plane, godot_quat, godot_aabb, godot_basis, godot_transform, godot_color, godot_node_path, godot_rid, godot_object, godot_dictionary, godot_array, godot_pool_byte_array, godot_pool_int_array, godot_pool_real_array, godot_pool_string_array, godot_pool_vector2_array, godot_pool_vector3_array, godot_pool_color_array)

GDNative type that gets passed to the C functions

conversionFromGodotType
alias conversionFromGodotType(T) = Unqual!(Parameters!(conversionFromGodot!T)[0])
Undocumented in source.
conversionToGodotType
alias conversionToGodotType(T) = Unqual!(ReturnType!(conversionToGodot!T))
Undocumented in source.

Enums

Operator
enum Operator
Type
enum Type

Functions

as
inout(T) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
R as()
Undocumented in source. Be warned that the author may not have intended to support it.
booleanize
bool booleanize()
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
void opAssign(T input)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
void opAssign(T nil)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
void opAssign(T other)
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(Variant other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Variant other)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
auto toString()
Undocumented in source. Be warned that the author may not have intended to support it.
type
Type type()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

nil
Variant nil()
Undocumented in source. Be warned that the author may not have intended to support it.

Templates

compatibleFromGodot
template compatibleFromGodot(T)
Undocumented in source.
compatibleToGodot
template compatibleToGodot(T)
Undocumented in source.
conversionFromGodot
template conversionFromGodot(T)

function to convert a Godot-compatible type to T

conversionToGodot
template conversionToGodot(T)

function to convert T to an equivalent Godot type

variantTypeOf
template variantTypeOf(T)

Get the Variant.Type of a compatible D type. Incompatible types return nil.

Variables

_godot_variant
godot_variant _godot_variant;
Undocumented in source.
compatible
enum bool compatible(R);
Undocumented in source.
convertsFromGodot
enum bool convertsFromGodot(T);
Undocumented in source.
convertsToGodot
enum bool convertsToGodot(T);
Undocumented in source.
directlyCompatible
enum bool directlyCompatible(T);
Undocumented in source.

Meta