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.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.visualscriptnode; 24 import godot.resource; 25 import godot.reference; 26 /** 27 Changes a variable's value. 28 29 Changes a variable's value to the given input. 30 $(B Input Ports:) 31 - Sequence 32 - Data (variant): `set` 33 $(B Output Ports:) 34 - Sequence 35 */ 36 @GodotBaseClass struct VisualScriptVariableSet 37 { 38 enum string _GODOT_internal_name = "VisualScriptVariableSet"; 39 public: 40 @nogc nothrow: 41 union { godot_object _godot_object; VisualScriptNode _GODOT_base; } 42 alias _GODOT_base this; 43 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 44 package(godot) __gshared bool _classBindingInitialized = false; 45 package(godot) static struct _classBinding 46 { 47 __gshared: 48 @GodotName("set_variable") GodotMethod!(void, String) setVariable; 49 @GodotName("get_variable") GodotMethod!(String) getVariable; 50 } 51 bool opEquals(in VisualScriptVariableSet other) const { return _godot_object.ptr is other._godot_object.ptr; } 52 VisualScriptVariableSet opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 53 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 54 mixin baseCasts; 55 static VisualScriptVariableSet _new() 56 { 57 static godot_class_constructor constructor; 58 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptVariableSet"); 59 if(constructor is null) return typeof(this).init; 60 return cast(VisualScriptVariableSet)(constructor()); 61 } 62 @disable new(size_t s); 63 /** 64 65 */ 66 void setVariable(StringArg0)(in StringArg0 name) 67 { 68 checkClassBinding!(typeof(this))(); 69 ptrcall!(void)(_classBinding.setVariable, _godot_object, name); 70 } 71 /** 72 73 */ 74 String getVariable() const 75 { 76 checkClassBinding!(typeof(this))(); 77 return ptrcall!(String)(_classBinding.getVariable, _godot_object); 78 } 79 /** 80 The variable's name. 81 */ 82 @property String varName() 83 { 84 return getVariable(); 85 } 86 /// ditto 87 @property void varName(String v) 88 { 89 setVariable(v); 90 } 91 }