1 /**
2 Plays an animation once in $(D AnimationNodeBlendTree).
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.animationnodeoneshot;
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.animationnode;
25 import godot.resource;
26 /**
27 Plays an animation once in $(D AnimationNodeBlendTree).
28 
29 A resource to add to an $(D AnimationNodeBlendTree). This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
30 */
31 @GodotBaseClass struct AnimationNodeOneShot
32 {
33 	package(godot) enum string _GODOT_internal_name = "AnimationNodeOneShot";
34 public:
35 @nogc nothrow:
36 	union { /** */ godot_object _godot_object; /** */ AnimationNode _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 GDNativeClassBinding
41 	{
42 		__gshared:
43 		@GodotName("get_autorestart_delay") GodotMethod!(double) getAutorestartDelay;
44 		@GodotName("get_autorestart_random_delay") GodotMethod!(double) getAutorestartRandomDelay;
45 		@GodotName("get_fadein_time") GodotMethod!(double) getFadeinTime;
46 		@GodotName("get_fadeout_time") GodotMethod!(double) getFadeoutTime;
47 		@GodotName("get_mix_mode") GodotMethod!(AnimationNodeOneShot.MixMode) getMixMode;
48 		@GodotName("has_autorestart") GodotMethod!(bool) hasAutorestart;
49 		@GodotName("is_using_sync") GodotMethod!(bool) isUsingSync;
50 		@GodotName("set_autorestart") GodotMethod!(void, bool) setAutorestart;
51 		@GodotName("set_autorestart_delay") GodotMethod!(void, double) setAutorestartDelay;
52 		@GodotName("set_autorestart_random_delay") GodotMethod!(void, double) setAutorestartRandomDelay;
53 		@GodotName("set_fadein_time") GodotMethod!(void, double) setFadeinTime;
54 		@GodotName("set_fadeout_time") GodotMethod!(void, double) setFadeoutTime;
55 		@GodotName("set_mix_mode") GodotMethod!(void, long) setMixMode;
56 		@GodotName("set_use_sync") GodotMethod!(void, bool) setUseSync;
57 	}
58 	/// 
59 	pragma(inline, true) bool opEquals(in AnimationNodeOneShot other) const
60 	{ return _godot_object.ptr is other._godot_object.ptr; }
61 	/// 
62 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
63 	{ _godot_object.ptr = n; return null; }
64 	/// 
65 	pragma(inline, true) bool opEquals(typeof(null) n) const
66 	{ return _godot_object.ptr is n; }
67 	/// 
68 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
69 	mixin baseCasts;
70 	/// Construct a new instance of AnimationNodeOneShot.
71 	/// Note: use `memnew!AnimationNodeOneShot` instead.
72 	static AnimationNodeOneShot _new()
73 	{
74 		static godot_class_constructor constructor;
75 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AnimationNodeOneShot");
76 		if(constructor is null) return typeof(this).init;
77 		return cast(AnimationNodeOneShot)(constructor());
78 	}
79 	@disable new(size_t s);
80 	/// 
81 	enum MixMode : int
82 	{
83 		/**
84 		
85 		*/
86 		mixModeBlend = 0,
87 		/**
88 		
89 		*/
90 		mixModeAdd = 1,
91 	}
92 	/// 
93 	enum Constants : int
94 	{
95 		mixModeBlend = 0,
96 		mixModeAdd = 1,
97 	}
98 	/**
99 	
100 	*/
101 	double getAutorestartDelay() const
102 	{
103 		checkClassBinding!(typeof(this))();
104 		return ptrcall!(double)(GDNativeClassBinding.getAutorestartDelay, _godot_object);
105 	}
106 	/**
107 	
108 	*/
109 	double getAutorestartRandomDelay() const
110 	{
111 		checkClassBinding!(typeof(this))();
112 		return ptrcall!(double)(GDNativeClassBinding.getAutorestartRandomDelay, _godot_object);
113 	}
114 	/**
115 	
116 	*/
117 	double getFadeinTime() const
118 	{
119 		checkClassBinding!(typeof(this))();
120 		return ptrcall!(double)(GDNativeClassBinding.getFadeinTime, _godot_object);
121 	}
122 	/**
123 	
124 	*/
125 	double getFadeoutTime() const
126 	{
127 		checkClassBinding!(typeof(this))();
128 		return ptrcall!(double)(GDNativeClassBinding.getFadeoutTime, _godot_object);
129 	}
130 	/**
131 	
132 	*/
133 	AnimationNodeOneShot.MixMode getMixMode() const
134 	{
135 		checkClassBinding!(typeof(this))();
136 		return ptrcall!(AnimationNodeOneShot.MixMode)(GDNativeClassBinding.getMixMode, _godot_object);
137 	}
138 	/**
139 	
140 	*/
141 	bool hasAutorestart() const
142 	{
143 		checkClassBinding!(typeof(this))();
144 		return ptrcall!(bool)(GDNativeClassBinding.hasAutorestart, _godot_object);
145 	}
146 	/**
147 	
148 	*/
149 	bool isUsingSync() const
150 	{
151 		checkClassBinding!(typeof(this))();
152 		return ptrcall!(bool)(GDNativeClassBinding.isUsingSync, _godot_object);
153 	}
154 	/**
155 	
156 	*/
157 	void setAutorestart(in bool enable)
158 	{
159 		checkClassBinding!(typeof(this))();
160 		ptrcall!(void)(GDNativeClassBinding.setAutorestart, _godot_object, enable);
161 	}
162 	/**
163 	
164 	*/
165 	void setAutorestartDelay(in double enable)
166 	{
167 		checkClassBinding!(typeof(this))();
168 		ptrcall!(void)(GDNativeClassBinding.setAutorestartDelay, _godot_object, enable);
169 	}
170 	/**
171 	
172 	*/
173 	void setAutorestartRandomDelay(in double enable)
174 	{
175 		checkClassBinding!(typeof(this))();
176 		ptrcall!(void)(GDNativeClassBinding.setAutorestartRandomDelay, _godot_object, enable);
177 	}
178 	/**
179 	
180 	*/
181 	void setFadeinTime(in double time)
182 	{
183 		checkClassBinding!(typeof(this))();
184 		ptrcall!(void)(GDNativeClassBinding.setFadeinTime, _godot_object, time);
185 	}
186 	/**
187 	
188 	*/
189 	void setFadeoutTime(in double time)
190 	{
191 		checkClassBinding!(typeof(this))();
192 		ptrcall!(void)(GDNativeClassBinding.setFadeoutTime, _godot_object, time);
193 	}
194 	/**
195 	
196 	*/
197 	void setMixMode(in long mode)
198 	{
199 		checkClassBinding!(typeof(this))();
200 		ptrcall!(void)(GDNativeClassBinding.setMixMode, _godot_object, mode);
201 	}
202 	/**
203 	
204 	*/
205 	void setUseSync(in bool enable)
206 	{
207 		checkClassBinding!(typeof(this))();
208 		ptrcall!(void)(GDNativeClassBinding.setUseSync, _godot_object, enable);
209 	}
210 	/**
211 	If `true`, the sub-animation will restart automatically after finishing.
212 	*/
213 	@property bool autorestart()
214 	{
215 		return hasAutorestart();
216 	}
217 	/// ditto
218 	@property void autorestart(bool v)
219 	{
220 		setAutorestart(v);
221 	}
222 	/**
223 	The delay after which the automatic restart is triggered, in seconds.
224 	*/
225 	@property double autorestartDelay()
226 	{
227 		return getAutorestartDelay();
228 	}
229 	/// ditto
230 	@property void autorestartDelay(double v)
231 	{
232 		setAutorestartDelay(v);
233 	}
234 	/**
235 	If $(D autorestart) is `true`, a random additional delay (in seconds) between 0 and this value will be added to $(D autorestartDelay).
236 	*/
237 	@property double autorestartRandomDelay()
238 	{
239 		return getAutorestartRandomDelay();
240 	}
241 	/// ditto
242 	@property void autorestartRandomDelay(double v)
243 	{
244 		setAutorestartRandomDelay(v);
245 	}
246 	/**
247 	
248 	*/
249 	@property double fadeinTime()
250 	{
251 		return getFadeinTime();
252 	}
253 	/// ditto
254 	@property void fadeinTime(double v)
255 	{
256 		setFadeinTime(v);
257 	}
258 	/**
259 	
260 	*/
261 	@property double fadeoutTime()
262 	{
263 		return getFadeoutTime();
264 	}
265 	/// ditto
266 	@property void fadeoutTime(double v)
267 	{
268 		setFadeoutTime(v);
269 	}
270 	/**
271 	
272 	*/
273 	@property bool sync()
274 	{
275 		return isUsingSync();
276 	}
277 	/// ditto
278 	@property void sync(bool v)
279 	{
280 		setUseSync(v);
281 	}
282 }