1 /**
2 Gets 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.visualscriptvariableget;
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 Gets a variable's value.
29 
30 Returns a variable's value. "Var Name" must be supplied, with an optional type.
31 $(B Input Ports:)
32 none
33 $(B Output Ports:)
34 - Data (variant): `value`
35 */
36 @GodotBaseClass struct VisualScriptVariableGet
37 {
38 	package(godot) enum string _GODOT_internal_name = "VisualScriptVariableGet";
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 GDNativeClassBinding
46 	{
47 		__gshared:
48 		@GodotName("get_variable") GodotMethod!(String) getVariable;
49 		@GodotName("set_variable") GodotMethod!(void, String) setVariable;
50 	}
51 	/// 
52 	pragma(inline, true) bool opEquals(in VisualScriptVariableGet other) const
53 	{ return _godot_object.ptr is other._godot_object.ptr; }
54 	/// 
55 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
56 	{ _godot_object.ptr = n; return null; }
57 	/// 
58 	pragma(inline, true) bool opEquals(typeof(null) n) const
59 	{ return _godot_object.ptr is n; }
60 	/// 
61 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
62 	mixin baseCasts;
63 	/// Construct a new instance of VisualScriptVariableGet.
64 	/// Note: use `memnew!VisualScriptVariableGet` instead.
65 	static VisualScriptVariableGet _new()
66 	{
67 		static godot_class_constructor constructor;
68 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptVariableGet");
69 		if(constructor is null) return typeof(this).init;
70 		return cast(VisualScriptVariableGet)(constructor());
71 	}
72 	@disable new(size_t s);
73 	/**
74 	
75 	*/
76 	String getVariable() const
77 	{
78 		checkClassBinding!(typeof(this))();
79 		return ptrcall!(String)(GDNativeClassBinding.getVariable, _godot_object);
80 	}
81 	/**
82 	
83 	*/
84 	void setVariable(in String name)
85 	{
86 		checkClassBinding!(typeof(this))();
87 		ptrcall!(void)(GDNativeClassBinding.setVariable, _godot_object, name);
88 	}
89 	/**
90 	The variable's name.
91 	*/
92 	@property String varName()
93 	{
94 		return getVariable();
95 	}
96 	/// ditto
97 	@property void varName(String v)
98 	{
99 		setVariable(v);
100 	}
101 }