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.animationnode; 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.resource; 24 import godot.reference; 25 /** 26 27 */ 28 @GodotBaseClass struct AnimationNode 29 { 30 enum string _GODOT_internal_name = "AnimationNode"; 31 public: 32 @nogc nothrow: 33 union { godot_object _godot_object; Resource _GODOT_base; } 34 alias _GODOT_base this; 35 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 36 package(godot) __gshared bool _classBindingInitialized = false; 37 package(godot) static struct _classBinding 38 { 39 __gshared: 40 @GodotName("process") GodotMethod!(void, double, bool) process; 41 @GodotName("get_caption") GodotMethod!(String) getCaption; 42 @GodotName("has_filter") GodotMethod!(String) hasFilter; 43 @GodotName("get_input_count") GodotMethod!(long) getInputCount; 44 @GodotName("get_input_name") GodotMethod!(String, long) getInputName; 45 @GodotName("add_input") GodotMethod!(void, String) addInput; 46 @GodotName("remove_input") GodotMethod!(void, long) removeInput; 47 @GodotName("set_filter_path") GodotMethod!(void, NodePath, bool) setFilterPath; 48 @GodotName("is_path_filtered") GodotMethod!(bool, NodePath) isPathFiltered; 49 @GodotName("set_filter_enabled") GodotMethod!(void, bool) setFilterEnabled; 50 @GodotName("is_filter_enabled") GodotMethod!(bool) isFilterEnabled; 51 @GodotName("_set_filters") GodotMethod!(void, Array) _setFilters; 52 @GodotName("_get_filters") GodotMethod!(Array) _getFilters; 53 @GodotName("blend_animation") GodotMethod!(void, String, double, double, bool, double) blendAnimation; 54 @GodotName("blend_node") GodotMethod!(double, String, AnimationNode, double, bool, double, long, bool) blendNode; 55 @GodotName("blend_input") GodotMethod!(double, long, double, bool, double, long, bool) blendInput; 56 @GodotName("set_parameter") GodotMethod!(void, String, Variant) setParameter; 57 @GodotName("get_parameter") GodotMethod!(Variant, String) getParameter; 58 } 59 bool opEquals(in AnimationNode other) const { return _godot_object.ptr is other._godot_object.ptr; } 60 AnimationNode opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 61 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 62 mixin baseCasts; 63 static AnimationNode _new() 64 { 65 static godot_class_constructor constructor; 66 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AnimationNode"); 67 if(constructor is null) return typeof(this).init; 68 return cast(AnimationNode)(constructor()); 69 } 70 @disable new(size_t s); 71 /// 72 enum FilterAction : int 73 { 74 /** 75 76 */ 77 filterIgnore = 0, 78 /** 79 80 */ 81 filterPass = 1, 82 /** 83 84 */ 85 filterStop = 2, 86 /** 87 88 */ 89 filterBlend = 3, 90 } 91 /// 92 enum Constants : int 93 { 94 filterIgnore = 0, 95 filterPass = 1, 96 filterStop = 2, 97 filterBlend = 3, 98 } 99 /** 100 101 */ 102 void process(in double time, in bool seek) 103 { 104 Array _GODOT_args = Array.empty_array; 105 _GODOT_args.append(time); 106 _GODOT_args.append(seek); 107 String _GODOT_method_name = String("process"); 108 this.callv(_GODOT_method_name, _GODOT_args); 109 } 110 /** 111 112 */ 113 String getCaption() 114 { 115 Array _GODOT_args = Array.empty_array; 116 String _GODOT_method_name = String("get_caption"); 117 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!String); 118 } 119 /** 120 121 */ 122 String hasFilter() 123 { 124 Array _GODOT_args = Array.empty_array; 125 String _GODOT_method_name = String("has_filter"); 126 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!String); 127 } 128 /** 129 130 */ 131 long getInputCount() const 132 { 133 checkClassBinding!(typeof(this))(); 134 return ptrcall!(long)(_classBinding.getInputCount, _godot_object); 135 } 136 /** 137 138 */ 139 String getInputName(in long input) 140 { 141 checkClassBinding!(typeof(this))(); 142 return ptrcall!(String)(_classBinding.getInputName, _godot_object, input); 143 } 144 /** 145 146 */ 147 void addInput(StringArg0)(in StringArg0 name) 148 { 149 checkClassBinding!(typeof(this))(); 150 ptrcall!(void)(_classBinding.addInput, _godot_object, name); 151 } 152 /** 153 154 */ 155 void removeInput(in long index) 156 { 157 checkClassBinding!(typeof(this))(); 158 ptrcall!(void)(_classBinding.removeInput, _godot_object, index); 159 } 160 /** 161 162 */ 163 void setFilterPath(NodePathArg0)(in NodePathArg0 path, in bool enable) 164 { 165 checkClassBinding!(typeof(this))(); 166 ptrcall!(void)(_classBinding.setFilterPath, _godot_object, path, enable); 167 } 168 /** 169 170 */ 171 bool isPathFiltered(NodePathArg0)(in NodePathArg0 path) const 172 { 173 checkClassBinding!(typeof(this))(); 174 return ptrcall!(bool)(_classBinding.isPathFiltered, _godot_object, path); 175 } 176 /** 177 178 */ 179 void setFilterEnabled(in bool enable) 180 { 181 checkClassBinding!(typeof(this))(); 182 ptrcall!(void)(_classBinding.setFilterEnabled, _godot_object, enable); 183 } 184 /** 185 186 */ 187 bool isFilterEnabled() const 188 { 189 checkClassBinding!(typeof(this))(); 190 return ptrcall!(bool)(_classBinding.isFilterEnabled, _godot_object); 191 } 192 /** 193 194 */ 195 void _setFilters(in Array filters) 196 { 197 Array _GODOT_args = Array.empty_array; 198 _GODOT_args.append(filters); 199 String _GODOT_method_name = String("_set_filters"); 200 this.callv(_GODOT_method_name, _GODOT_args); 201 } 202 /** 203 204 */ 205 Array _getFilters() const 206 { 207 Array _GODOT_args = Array.empty_array; 208 String _GODOT_method_name = String("_get_filters"); 209 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!Array); 210 } 211 /** 212 213 */ 214 void blendAnimation(StringArg0)(in StringArg0 animation, in double time, in double delta, in bool seeked, in double blend) 215 { 216 checkClassBinding!(typeof(this))(); 217 ptrcall!(void)(_classBinding.blendAnimation, _godot_object, animation, time, delta, seeked, blend); 218 } 219 /** 220 221 */ 222 double blendNode(StringArg0)(in StringArg0 name, AnimationNode node, in double time, in bool seek, in double blend, in long filter = 0, in bool optimize = true) 223 { 224 checkClassBinding!(typeof(this))(); 225 return ptrcall!(double)(_classBinding.blendNode, _godot_object, name, node, time, seek, blend, filter, optimize); 226 } 227 /** 228 229 */ 230 double blendInput(in long input_index, in double time, in bool seek, in double blend, in long filter = 0, in bool optimize = true) 231 { 232 checkClassBinding!(typeof(this))(); 233 return ptrcall!(double)(_classBinding.blendInput, _godot_object, input_index, time, seek, blend, filter, optimize); 234 } 235 /** 236 237 */ 238 void setParameter(StringArg0, VariantArg1)(in StringArg0 name, in VariantArg1 value) 239 { 240 checkClassBinding!(typeof(this))(); 241 ptrcall!(void)(_classBinding.setParameter, _godot_object, name, value); 242 } 243 /** 244 245 */ 246 Variant getParameter(StringArg0)(in StringArg0 name) const 247 { 248 checkClassBinding!(typeof(this))(); 249 return ptrcall!(Variant)(_classBinding.getParameter, _godot_object, name); 250 } 251 /** 252 253 */ 254 @property bool filterEnabled() 255 { 256 return isFilterEnabled(); 257 } 258 /// ditto 259 @property void filterEnabled(bool v) 260 { 261 setFilterEnabled(v); 262 } 263 /** 264 265 */ 266 @property Array filters() 267 { 268 return _getFilters(); 269 } 270 /// ditto 271 @property void filters(Array v) 272 { 273 _setFilters(v); 274 } 275 }