1 /** 2 Changes a variable's value. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.visualscriptvariableset; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.visualscriptnode; 25 import godot.resource; 26 import godot.reference; 27 /** 28 Changes a variable's value. 29 30 Changes a variable's value to the given input. 31 $(B Input Ports:) 32 - Sequence 33 - Data (variant): `set` 34 $(B Output Ports:) 35 - Sequence 36 */ 37 @GodotBaseClass struct VisualScriptVariableSet 38 { 39 package(godot) enum string _GODOT_internal_name = "VisualScriptVariableSet"; 40 public: 41 @nogc nothrow: 42 union { /** */ godot_object _godot_object; /** */ VisualScriptNode _GODOT_base; } 43 alias _GODOT_base this; 44 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 45 package(godot) __gshared bool _classBindingInitialized = false; 46 package(godot) static struct GDNativeClassBinding 47 { 48 __gshared: 49 @GodotName("get_variable") GodotMethod!(String) getVariable; 50 @GodotName("set_variable") GodotMethod!(void, String) setVariable; 51 } 52 /// 53 pragma(inline, true) bool opEquals(in VisualScriptVariableSet other) const 54 { return _godot_object.ptr is other._godot_object.ptr; } 55 /// 56 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 57 { _godot_object.ptr = n; return null; } 58 /// 59 pragma(inline, true) bool opEquals(typeof(null) n) const 60 { return _godot_object.ptr is n; } 61 /// 62 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 63 mixin baseCasts; 64 /// Construct a new instance of VisualScriptVariableSet. 65 /// Note: use `memnew!VisualScriptVariableSet` instead. 66 static VisualScriptVariableSet _new() 67 { 68 static godot_class_constructor constructor; 69 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptVariableSet"); 70 if(constructor is null) return typeof(this).init; 71 return cast(VisualScriptVariableSet)(constructor()); 72 } 73 @disable new(size_t s); 74 /** 75 76 */ 77 String getVariable() const 78 { 79 checkClassBinding!(typeof(this))(); 80 return ptrcall!(String)(GDNativeClassBinding.getVariable, _godot_object); 81 } 82 /** 83 84 */ 85 void setVariable(in String name) 86 { 87 checkClassBinding!(typeof(this))(); 88 ptrcall!(void)(GDNativeClassBinding.setVariable, _godot_object, name); 89 } 90 /** 91 The variable's name. 92 */ 93 @property String varName() 94 { 95 return getVariable(); 96 } 97 /// ditto 98 @property void varName(String v) 99 { 100 setVariable(v); 101 } 102 }