1 /**
2 
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.animationnodestatemachine;
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.animationrootnode;
24 import godot.animationnode;
25 import godot.animationnodestatemachinetransition;
26 import godot.resource;
27 import godot.reference;
28 /**
29 
30 */
31 @GodotBaseClass struct AnimationNodeStateMachine
32 {
33 	enum string _GODOT_internal_name = "AnimationNodeStateMachine";
34 public:
35 @nogc nothrow:
36 	union { godot_object _godot_object; AnimationRootNode _GODOT_base; }
37 	alias _GODOT_base this;
38 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
39 	package(godot) __gshared bool _classBindingInitialized = false;
40 	package(godot) static struct _classBinding
41 	{
42 		__gshared:
43 		@GodotName("add_node") GodotMethod!(void, String, AnimationNode, Vector2) addNode;
44 		@GodotName("get_node") GodotMethod!(AnimationNode, String) getNode;
45 		@GodotName("remove_node") GodotMethod!(void, String) removeNode;
46 		@GodotName("rename_node") GodotMethod!(void, String, String) renameNode;
47 		@GodotName("has_node") GodotMethod!(bool, String) hasNode;
48 		@GodotName("get_node_name") GodotMethod!(String, AnimationNode) getNodeName;
49 		@GodotName("set_node_position") GodotMethod!(void, String, Vector2) setNodePosition;
50 		@GodotName("get_node_position") GodotMethod!(Vector2, String) getNodePosition;
51 		@GodotName("has_transition") GodotMethod!(bool, String, String) hasTransition;
52 		@GodotName("add_transition") GodotMethod!(void, String, String, AnimationNodeStateMachineTransition) addTransition;
53 		@GodotName("get_transition") GodotMethod!(AnimationNodeStateMachineTransition, long) getTransition;
54 		@GodotName("get_transition_from") GodotMethod!(String, long) getTransitionFrom;
55 		@GodotName("get_transition_to") GodotMethod!(String, long) getTransitionTo;
56 		@GodotName("get_transition_count") GodotMethod!(long) getTransitionCount;
57 		@GodotName("remove_transition_by_index") GodotMethod!(void, long) removeTransitionByIndex;
58 		@GodotName("remove_transition") GodotMethod!(void, String, String) removeTransition;
59 		@GodotName("set_start_node") GodotMethod!(void, String) setStartNode;
60 		@GodotName("get_start_node") GodotMethod!(String) getStartNode;
61 		@GodotName("set_end_node") GodotMethod!(void, String) setEndNode;
62 		@GodotName("get_end_node") GodotMethod!(String) getEndNode;
63 		@GodotName("set_graph_offset") GodotMethod!(void, Vector2) setGraphOffset;
64 		@GodotName("get_graph_offset") GodotMethod!(Vector2) getGraphOffset;
65 		@GodotName("_tree_changed") GodotMethod!(void) _treeChanged;
66 	}
67 	bool opEquals(in AnimationNodeStateMachine other) const { return _godot_object.ptr is other._godot_object.ptr; }
68 	AnimationNodeStateMachine opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
69 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
70 	mixin baseCasts;
71 	static AnimationNodeStateMachine _new()
72 	{
73 		static godot_class_constructor constructor;
74 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AnimationNodeStateMachine");
75 		if(constructor is null) return typeof(this).init;
76 		return cast(AnimationNodeStateMachine)(constructor());
77 	}
78 	@disable new(size_t s);
79 	/**
80 	
81 	*/
82 	void addNode(StringArg0)(in StringArg0 name, AnimationNode node, in Vector2 position = Vector2(0, 0))
83 	{
84 		checkClassBinding!(typeof(this))();
85 		ptrcall!(void)(_classBinding.addNode, _godot_object, name, node, position);
86 	}
87 	/**
88 	
89 	*/
90 	Ref!AnimationNode getNode(StringArg0)(in StringArg0 name) const
91 	{
92 		checkClassBinding!(typeof(this))();
93 		return ptrcall!(AnimationNode)(_classBinding.getNode, _godot_object, name);
94 	}
95 	/**
96 	
97 	*/
98 	void removeNode(StringArg0)(in StringArg0 name)
99 	{
100 		checkClassBinding!(typeof(this))();
101 		ptrcall!(void)(_classBinding.removeNode, _godot_object, name);
102 	}
103 	/**
104 	
105 	*/
106 	void renameNode(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 new_name)
107 	{
108 		checkClassBinding!(typeof(this))();
109 		ptrcall!(void)(_classBinding.renameNode, _godot_object, name, new_name);
110 	}
111 	/**
112 	
113 	*/
114 	bool hasNode(StringArg0)(in StringArg0 name) const
115 	{
116 		checkClassBinding!(typeof(this))();
117 		return ptrcall!(bool)(_classBinding.hasNode, _godot_object, name);
118 	}
119 	/**
120 	
121 	*/
122 	String getNodeName(AnimationNode node) const
123 	{
124 		checkClassBinding!(typeof(this))();
125 		return ptrcall!(String)(_classBinding.getNodeName, _godot_object, node);
126 	}
127 	/**
128 	
129 	*/
130 	void setNodePosition(StringArg0)(in StringArg0 name, in Vector2 position)
131 	{
132 		checkClassBinding!(typeof(this))();
133 		ptrcall!(void)(_classBinding.setNodePosition, _godot_object, name, position);
134 	}
135 	/**
136 	
137 	*/
138 	Vector2 getNodePosition(StringArg0)(in StringArg0 name) const
139 	{
140 		checkClassBinding!(typeof(this))();
141 		return ptrcall!(Vector2)(_classBinding.getNodePosition, _godot_object, name);
142 	}
143 	/**
144 	
145 	*/
146 	bool hasTransition(StringArg0, StringArg1)(in StringArg0 from, in StringArg1 to) const
147 	{
148 		checkClassBinding!(typeof(this))();
149 		return ptrcall!(bool)(_classBinding.hasTransition, _godot_object, from, to);
150 	}
151 	/**
152 	
153 	*/
154 	void addTransition(StringArg0, StringArg1)(in StringArg0 from, in StringArg1 to, AnimationNodeStateMachineTransition transition)
155 	{
156 		checkClassBinding!(typeof(this))();
157 		ptrcall!(void)(_classBinding.addTransition, _godot_object, from, to, transition);
158 	}
159 	/**
160 	
161 	*/
162 	Ref!AnimationNodeStateMachineTransition getTransition(in long idx) const
163 	{
164 		checkClassBinding!(typeof(this))();
165 		return ptrcall!(AnimationNodeStateMachineTransition)(_classBinding.getTransition, _godot_object, idx);
166 	}
167 	/**
168 	
169 	*/
170 	String getTransitionFrom(in long idx) const
171 	{
172 		checkClassBinding!(typeof(this))();
173 		return ptrcall!(String)(_classBinding.getTransitionFrom, _godot_object, idx);
174 	}
175 	/**
176 	
177 	*/
178 	String getTransitionTo(in long idx) const
179 	{
180 		checkClassBinding!(typeof(this))();
181 		return ptrcall!(String)(_classBinding.getTransitionTo, _godot_object, idx);
182 	}
183 	/**
184 	
185 	*/
186 	long getTransitionCount() const
187 	{
188 		checkClassBinding!(typeof(this))();
189 		return ptrcall!(long)(_classBinding.getTransitionCount, _godot_object);
190 	}
191 	/**
192 	
193 	*/
194 	void removeTransitionByIndex(in long idx)
195 	{
196 		checkClassBinding!(typeof(this))();
197 		ptrcall!(void)(_classBinding.removeTransitionByIndex, _godot_object, idx);
198 	}
199 	/**
200 	
201 	*/
202 	void removeTransition(StringArg0, StringArg1)(in StringArg0 from, in StringArg1 to)
203 	{
204 		checkClassBinding!(typeof(this))();
205 		ptrcall!(void)(_classBinding.removeTransition, _godot_object, from, to);
206 	}
207 	/**
208 	
209 	*/
210 	void setStartNode(StringArg0)(in StringArg0 name)
211 	{
212 		checkClassBinding!(typeof(this))();
213 		ptrcall!(void)(_classBinding.setStartNode, _godot_object, name);
214 	}
215 	/**
216 	
217 	*/
218 	String getStartNode() const
219 	{
220 		checkClassBinding!(typeof(this))();
221 		return ptrcall!(String)(_classBinding.getStartNode, _godot_object);
222 	}
223 	/**
224 	
225 	*/
226 	void setEndNode(StringArg0)(in StringArg0 name)
227 	{
228 		checkClassBinding!(typeof(this))();
229 		ptrcall!(void)(_classBinding.setEndNode, _godot_object, name);
230 	}
231 	/**
232 	
233 	*/
234 	String getEndNode() const
235 	{
236 		checkClassBinding!(typeof(this))();
237 		return ptrcall!(String)(_classBinding.getEndNode, _godot_object);
238 	}
239 	/**
240 	
241 	*/
242 	void setGraphOffset(in Vector2 name)
243 	{
244 		checkClassBinding!(typeof(this))();
245 		ptrcall!(void)(_classBinding.setGraphOffset, _godot_object, name);
246 	}
247 	/**
248 	
249 	*/
250 	Vector2 getGraphOffset() const
251 	{
252 		checkClassBinding!(typeof(this))();
253 		return ptrcall!(Vector2)(_classBinding.getGraphOffset, _godot_object);
254 	}
255 	/**
256 	
257 	*/
258 	void _treeChanged()
259 	{
260 		Array _GODOT_args = Array.empty_array;
261 		String _GODOT_method_name = String("_tree_changed");
262 		this.callv(_GODOT_method_name, _GODOT_args);
263 	}
264 }