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