1 /**
2 Changes a local 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.visualscriptlocalvarset;
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 /**
26 Changes a local variable's value.
27 
28 Changes a local variable's value to the given input. The new value is also provided on an output Data port.
29 $(B Input Ports:)
30 - Sequence
31 - Data (variant): `set`
32 $(B Output Ports:)
33 - Sequence
34 - Data (variant): `get`
35 */
36 @GodotBaseClass struct VisualScriptLocalVarSet
37 {
38 	package(godot) enum string _GODOT_internal_name = "VisualScriptLocalVarSet";
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_var_name") GodotMethod!(String) getVarName;
49 		@GodotName("get_var_type") GodotMethod!(Variant.Type) getVarType;
50 		@GodotName("set_var_name") GodotMethod!(void, String) setVarName;
51 		@GodotName("set_var_type") GodotMethod!(void, long) setVarType;
52 	}
53 	/// 
54 	pragma(inline, true) bool opEquals(in VisualScriptLocalVarSet other) const
55 	{ return _godot_object.ptr is other._godot_object.ptr; }
56 	/// 
57 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
58 	{ _godot_object.ptr = n; return null; }
59 	/// 
60 	pragma(inline, true) bool opEquals(typeof(null) n) const
61 	{ return _godot_object.ptr is n; }
62 	/// 
63 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
64 	mixin baseCasts;
65 	/// Construct a new instance of VisualScriptLocalVarSet.
66 	/// Note: use `memnew!VisualScriptLocalVarSet` instead.
67 	static VisualScriptLocalVarSet _new()
68 	{
69 		static godot_class_constructor constructor;
70 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptLocalVarSet");
71 		if(constructor is null) return typeof(this).init;
72 		return cast(VisualScriptLocalVarSet)(constructor());
73 	}
74 	@disable new(size_t s);
75 	/**
76 	
77 	*/
78 	String getVarName() const
79 	{
80 		checkClassBinding!(typeof(this))();
81 		return ptrcall!(String)(GDNativeClassBinding.getVarName, _godot_object);
82 	}
83 	/**
84 	
85 	*/
86 	Variant.Type getVarType() const
87 	{
88 		checkClassBinding!(typeof(this))();
89 		return ptrcall!(Variant.Type)(GDNativeClassBinding.getVarType, _godot_object);
90 	}
91 	/**
92 	
93 	*/
94 	void setVarName(in String name)
95 	{
96 		checkClassBinding!(typeof(this))();
97 		ptrcall!(void)(GDNativeClassBinding.setVarName, _godot_object, name);
98 	}
99 	/**
100 	
101 	*/
102 	void setVarType(in long type)
103 	{
104 		checkClassBinding!(typeof(this))();
105 		ptrcall!(void)(GDNativeClassBinding.setVarType, _godot_object, type);
106 	}
107 	/**
108 	The local variable's type.
109 	*/
110 	@property Variant.Type type()
111 	{
112 		return getVarType();
113 	}
114 	/// ditto
115 	@property void type(long v)
116 	{
117 		setVarType(v);
118 	}
119 	/**
120 	The local variable's name.
121 	*/
122 	@property String varName()
123 	{
124 		return getVarName();
125 	}
126 	/// ditto
127 	@property void varName(String v)
128 	{
129 		setVarName(v);
130 	}
131 }