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.springarm; 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.spatial; 24 import godot.shape; 25 import godot.node; 26 /** 27 28 */ 29 @GodotBaseClass struct SpringArm 30 { 31 enum string _GODOT_internal_name = "SpringArm"; 32 public: 33 @nogc nothrow: 34 union { godot_object _godot_object; Spatial _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("get_hit_length") GodotMethod!(double) getHitLength; 42 @GodotName("set_length") GodotMethod!(void, double) setLength; 43 @GodotName("get_length") GodotMethod!(double) getLength; 44 @GodotName("set_shape") GodotMethod!(void, Shape) setShape; 45 @GodotName("get_shape") GodotMethod!(Shape) getShape; 46 @GodotName("add_excluded_object") GodotMethod!(void, RID) addExcludedObject; 47 @GodotName("remove_excluded_object") GodotMethod!(bool, RID) removeExcludedObject; 48 @GodotName("clear_excluded_objects") GodotMethod!(void) clearExcludedObjects; 49 @GodotName("set_collision_mask") GodotMethod!(void, long) setCollisionMask; 50 @GodotName("get_collision_mask") GodotMethod!(long) getCollisionMask; 51 @GodotName("set_margin") GodotMethod!(void, double) setMargin; 52 @GodotName("get_margin") GodotMethod!(double) getMargin; 53 } 54 bool opEquals(in SpringArm other) const { return _godot_object.ptr is other._godot_object.ptr; } 55 SpringArm opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 56 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 57 mixin baseCasts; 58 static SpringArm _new() 59 { 60 static godot_class_constructor constructor; 61 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("SpringArm"); 62 if(constructor is null) return typeof(this).init; 63 return cast(SpringArm)(constructor()); 64 } 65 @disable new(size_t s); 66 /** 67 68 */ 69 double getHitLength() 70 { 71 checkClassBinding!(typeof(this))(); 72 return ptrcall!(double)(_classBinding.getHitLength, _godot_object); 73 } 74 /** 75 76 */ 77 void setLength(in double length) 78 { 79 checkClassBinding!(typeof(this))(); 80 ptrcall!(void)(_classBinding.setLength, _godot_object, length); 81 } 82 /** 83 84 */ 85 double getLength() const 86 { 87 checkClassBinding!(typeof(this))(); 88 return ptrcall!(double)(_classBinding.getLength, _godot_object); 89 } 90 /** 91 92 */ 93 void setShape(Shape shape) 94 { 95 checkClassBinding!(typeof(this))(); 96 ptrcall!(void)(_classBinding.setShape, _godot_object, shape); 97 } 98 /** 99 100 */ 101 Ref!Shape getShape() const 102 { 103 checkClassBinding!(typeof(this))(); 104 return ptrcall!(Shape)(_classBinding.getShape, _godot_object); 105 } 106 /** 107 108 */ 109 void addExcludedObject(in RID RID) 110 { 111 checkClassBinding!(typeof(this))(); 112 ptrcall!(void)(_classBinding.addExcludedObject, _godot_object, RID); 113 } 114 /** 115 116 */ 117 bool removeExcludedObject(in RID RID) 118 { 119 checkClassBinding!(typeof(this))(); 120 return ptrcall!(bool)(_classBinding.removeExcludedObject, _godot_object, RID); 121 } 122 /** 123 124 */ 125 void clearExcludedObjects() 126 { 127 checkClassBinding!(typeof(this))(); 128 ptrcall!(void)(_classBinding.clearExcludedObjects, _godot_object); 129 } 130 /** 131 132 */ 133 void setCollisionMask(in long mask) 134 { 135 checkClassBinding!(typeof(this))(); 136 ptrcall!(void)(_classBinding.setCollisionMask, _godot_object, mask); 137 } 138 /** 139 140 */ 141 long getCollisionMask() 142 { 143 checkClassBinding!(typeof(this))(); 144 return ptrcall!(long)(_classBinding.getCollisionMask, _godot_object); 145 } 146 /** 147 148 */ 149 void setMargin(in double margin) 150 { 151 checkClassBinding!(typeof(this))(); 152 ptrcall!(void)(_classBinding.setMargin, _godot_object, margin); 153 } 154 /** 155 156 */ 157 double getMargin() 158 { 159 checkClassBinding!(typeof(this))(); 160 return ptrcall!(double)(_classBinding.getMargin, _godot_object); 161 } 162 /** 163 164 */ 165 @property long collisionMask() 166 { 167 return getCollisionMask(); 168 } 169 /// ditto 170 @property void collisionMask(long v) 171 { 172 setCollisionMask(v); 173 } 174 /** 175 176 */ 177 @property Shape shape() 178 { 179 return getShape(); 180 } 181 /// ditto 182 @property void shape(Shape v) 183 { 184 setShape(v); 185 } 186 /** 187 188 */ 189 @property double springLength() 190 { 191 return getLength(); 192 } 193 /// ditto 194 @property void springLength(double v) 195 { 196 setLength(v); 197 } 198 /** 199 200 */ 201 @property double margin() 202 { 203 return getMargin(); 204 } 205 /// ditto 206 @property void margin(double v) 207 { 208 setMargin(v); 209 } 210 }