1 /** 2 Contains a $(D Curve2D) path for $(D PathFollow2D) nodes to follow. 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.path2d; 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.curve2d; 25 import godot.canvasitem; 26 import godot.node; 27 /** 28 Contains a $(D Curve2D) path for $(D PathFollow2D) nodes to follow. 29 30 Can have $(D PathFollow2D) child-nodes moving along the $(D Curve2D). See $(D PathFollow2D) for more information on this usage. 31 */ 32 @GodotBaseClass struct Path2D 33 { 34 enum string _GODOT_internal_name = "Path2D"; 35 public: 36 @nogc nothrow: 37 union { godot_object _godot_object; Node2D _GODOT_base; } 38 alias _GODOT_base this; 39 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 40 package(godot) __gshared bool _classBindingInitialized = false; 41 package(godot) static struct _classBinding 42 { 43 __gshared: 44 @GodotName("set_curve") GodotMethod!(void, Curve2D) setCurve; 45 @GodotName("get_curve") GodotMethod!(Curve2D) getCurve; 46 @GodotName("_curve_changed") GodotMethod!(void) _curveChanged; 47 } 48 bool opEquals(in Path2D other) const { return _godot_object.ptr is other._godot_object.ptr; } 49 Path2D opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 50 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 51 mixin baseCasts; 52 static Path2D _new() 53 { 54 static godot_class_constructor constructor; 55 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Path2D"); 56 if(constructor is null) return typeof(this).init; 57 return cast(Path2D)(constructor()); 58 } 59 @disable new(size_t s); 60 /** 61 62 */ 63 void setCurve(Curve2D curve) 64 { 65 checkClassBinding!(typeof(this))(); 66 ptrcall!(void)(_classBinding.setCurve, _godot_object, curve); 67 } 68 /** 69 70 */ 71 Ref!Curve2D getCurve() const 72 { 73 checkClassBinding!(typeof(this))(); 74 return ptrcall!(Curve2D)(_classBinding.getCurve, _godot_object); 75 } 76 /** 77 78 */ 79 void _curveChanged() 80 { 81 Array _GODOT_args = Array.empty_array; 82 String _GODOT_method_name = String("_curve_changed"); 83 this.callv(_GODOT_method_name, _GODOT_args); 84 } 85 /** 86 A $(D Curve2D) describing the path. 87 */ 88 @property Curve2D curve() 89 { 90 return getCurve(); 91 } 92 /// ditto 93 @property void curve(Curve2D v) 94 { 95 setCurve(v); 96 } 97 }