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.bone2d; 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.node2d; 24 import godot.canvasitem; 25 import godot.node; 26 /** 27 28 */ 29 @GodotBaseClass struct Bone2D 30 { 31 enum string _GODOT_internal_name = "Bone2D"; 32 public: 33 @nogc nothrow: 34 union { godot_object _godot_object; Node2D _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 _classBinding 39 { 40 __gshared: 41 @GodotName("set_rest") GodotMethod!(void, Transform2D) setRest; 42 @GodotName("get_rest") GodotMethod!(Transform2D) getRest; 43 @GodotName("apply_rest") GodotMethod!(void) applyRest; 44 @GodotName("get_skeleton_rest") GodotMethod!(Transform2D) getSkeletonRest; 45 @GodotName("get_index_in_skeleton") GodotMethod!(long) getIndexInSkeleton; 46 @GodotName("set_default_length") GodotMethod!(void, double) setDefaultLength; 47 @GodotName("get_default_length") GodotMethod!(double) getDefaultLength; 48 } 49 bool opEquals(in Bone2D other) const { return _godot_object.ptr is other._godot_object.ptr; } 50 Bone2D opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 51 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 52 mixin baseCasts; 53 static Bone2D _new() 54 { 55 static godot_class_constructor constructor; 56 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Bone2D"); 57 if(constructor is null) return typeof(this).init; 58 return cast(Bone2D)(constructor()); 59 } 60 @disable new(size_t s); 61 /** 62 63 */ 64 void setRest(in Transform2D rest) 65 { 66 checkClassBinding!(typeof(this))(); 67 ptrcall!(void)(_classBinding.setRest, _godot_object, rest); 68 } 69 /** 70 71 */ 72 Transform2D getRest() const 73 { 74 checkClassBinding!(typeof(this))(); 75 return ptrcall!(Transform2D)(_classBinding.getRest, _godot_object); 76 } 77 /** 78 79 */ 80 void applyRest() 81 { 82 checkClassBinding!(typeof(this))(); 83 ptrcall!(void)(_classBinding.applyRest, _godot_object); 84 } 85 /** 86 87 */ 88 Transform2D getSkeletonRest() const 89 { 90 checkClassBinding!(typeof(this))(); 91 return ptrcall!(Transform2D)(_classBinding.getSkeletonRest, _godot_object); 92 } 93 /** 94 95 */ 96 long getIndexInSkeleton() const 97 { 98 checkClassBinding!(typeof(this))(); 99 return ptrcall!(long)(_classBinding.getIndexInSkeleton, _godot_object); 100 } 101 /** 102 103 */ 104 void setDefaultLength(in double default_length) 105 { 106 checkClassBinding!(typeof(this))(); 107 ptrcall!(void)(_classBinding.setDefaultLength, _godot_object, default_length); 108 } 109 /** 110 111 */ 112 double getDefaultLength() const 113 { 114 checkClassBinding!(typeof(this))(); 115 return ptrcall!(double)(_classBinding.getDefaultLength, _godot_object); 116 } 117 /** 118 119 */ 120 @property Transform2D rest() 121 { 122 return getRest(); 123 } 124 /// ditto 125 @property void rest(Transform2D v) 126 { 127 setRest(v); 128 } 129 /** 130 131 */ 132 @property double defaultLength() 133 { 134 return getDefaultLength(); 135 } 136 /// ditto 137 @property void defaultLength(double v) 138 { 139 setDefaultLength(v); 140 } 141 }