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.skin; 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.resource; 25 import godot.reference; 26 /** 27 28 */ 29 @GodotBaseClass struct Skin 30 { 31 package(godot) enum string _GODOT_internal_name = "Skin"; 32 public: 33 @nogc nothrow: 34 union { /** */ godot_object _godot_object; /** */ Resource _GODOT_base; } 35 alias _GODOT_base this; 36 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 37 package(godot) __gshared bool _classBindingInitialized = false; 38 package(godot) static struct GDNativeClassBinding 39 { 40 __gshared: 41 @GodotName("add_bind") GodotMethod!(void, long, Transform) addBind; 42 @GodotName("clear_binds") GodotMethod!(void) clearBinds; 43 @GodotName("get_bind_bone") GodotMethod!(long, long) getBindBone; 44 @GodotName("get_bind_count") GodotMethod!(long) getBindCount; 45 @GodotName("get_bind_name") GodotMethod!(String, long) getBindName; 46 @GodotName("get_bind_pose") GodotMethod!(Transform, long) getBindPose; 47 @GodotName("set_bind_bone") GodotMethod!(void, long, long) setBindBone; 48 @GodotName("set_bind_count") GodotMethod!(void, long) setBindCount; 49 @GodotName("set_bind_name") GodotMethod!(void, long, String) setBindName; 50 @GodotName("set_bind_pose") GodotMethod!(void, long, Transform) setBindPose; 51 } 52 /// 53 pragma(inline, true) bool opEquals(in Skin other) const 54 { return _godot_object.ptr is other._godot_object.ptr; } 55 /// 56 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 57 { _godot_object.ptr = n; return null; } 58 /// 59 pragma(inline, true) bool opEquals(typeof(null) n) const 60 { return _godot_object.ptr is n; } 61 /// 62 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 63 mixin baseCasts; 64 /// Construct a new instance of Skin. 65 /// Note: use `memnew!Skin` instead. 66 static Skin _new() 67 { 68 static godot_class_constructor constructor; 69 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Skin"); 70 if(constructor is null) return typeof(this).init; 71 return cast(Skin)(constructor()); 72 } 73 @disable new(size_t s); 74 /** 75 76 */ 77 void addBind(in long bone, in Transform pose) 78 { 79 checkClassBinding!(typeof(this))(); 80 ptrcall!(void)(GDNativeClassBinding.addBind, _godot_object, bone, pose); 81 } 82 /** 83 84 */ 85 void clearBinds() 86 { 87 checkClassBinding!(typeof(this))(); 88 ptrcall!(void)(GDNativeClassBinding.clearBinds, _godot_object); 89 } 90 /** 91 92 */ 93 long getBindBone(in long bind_index) const 94 { 95 checkClassBinding!(typeof(this))(); 96 return ptrcall!(long)(GDNativeClassBinding.getBindBone, _godot_object, bind_index); 97 } 98 /** 99 100 */ 101 long getBindCount() const 102 { 103 checkClassBinding!(typeof(this))(); 104 return ptrcall!(long)(GDNativeClassBinding.getBindCount, _godot_object); 105 } 106 /** 107 108 */ 109 String getBindName(in long bind_index) const 110 { 111 checkClassBinding!(typeof(this))(); 112 return ptrcall!(String)(GDNativeClassBinding.getBindName, _godot_object, bind_index); 113 } 114 /** 115 116 */ 117 Transform getBindPose(in long bind_index) const 118 { 119 checkClassBinding!(typeof(this))(); 120 return ptrcall!(Transform)(GDNativeClassBinding.getBindPose, _godot_object, bind_index); 121 } 122 /** 123 124 */ 125 void setBindBone(in long bind_index, in long bone) 126 { 127 checkClassBinding!(typeof(this))(); 128 ptrcall!(void)(GDNativeClassBinding.setBindBone, _godot_object, bind_index, bone); 129 } 130 /** 131 132 */ 133 void setBindCount(in long bind_count) 134 { 135 checkClassBinding!(typeof(this))(); 136 ptrcall!(void)(GDNativeClassBinding.setBindCount, _godot_object, bind_count); 137 } 138 /** 139 140 */ 141 void setBindName(in long bind_index, in String name) 142 { 143 checkClassBinding!(typeof(this))(); 144 ptrcall!(void)(GDNativeClassBinding.setBindName, _godot_object, bind_index, name); 145 } 146 /** 147 148 */ 149 void setBindPose(in long bind_index, in Transform pose) 150 { 151 checkClassBinding!(typeof(this))(); 152 ptrcall!(void)(GDNativeClassBinding.setBindPose, _godot_object, bind_index, pose); 153 } 154 }