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.polygonpathfinder; 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 PolygonPathFinder 29 { 30 enum string _GODOT_internal_name = "PolygonPathFinder"; 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("setup") GodotMethod!(void, PoolVector2Array, PoolIntArray) setup; 41 @GodotName("find_path") GodotMethod!(PoolVector2Array, Vector2, Vector2) findPath; 42 @GodotName("get_intersections") GodotMethod!(PoolVector2Array, Vector2, Vector2) getIntersections; 43 @GodotName("get_closest_point") GodotMethod!(Vector2, Vector2) getClosestPoint; 44 @GodotName("is_point_inside") GodotMethod!(bool, Vector2) isPointInside; 45 @GodotName("set_point_penalty") GodotMethod!(void, long, double) setPointPenalty; 46 @GodotName("get_point_penalty") GodotMethod!(double, long) getPointPenalty; 47 @GodotName("get_bounds") GodotMethod!(Rect2) getBounds; 48 @GodotName("_set_data") GodotMethod!(void, Dictionary) _setData; 49 @GodotName("_get_data") GodotMethod!(Dictionary) _getData; 50 } 51 bool opEquals(in PolygonPathFinder other) const { return _godot_object.ptr is other._godot_object.ptr; } 52 PolygonPathFinder opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 53 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 54 mixin baseCasts; 55 static PolygonPathFinder _new() 56 { 57 static godot_class_constructor constructor; 58 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("PolygonPathFinder"); 59 if(constructor is null) return typeof(this).init; 60 return cast(PolygonPathFinder)(constructor()); 61 } 62 @disable new(size_t s); 63 /** 64 65 */ 66 void setup(in PoolVector2Array points, in PoolIntArray connections) 67 { 68 checkClassBinding!(typeof(this))(); 69 ptrcall!(void)(_classBinding.setup, _godot_object, points, connections); 70 } 71 /** 72 73 */ 74 PoolVector2Array findPath(in Vector2 from, in Vector2 to) 75 { 76 checkClassBinding!(typeof(this))(); 77 return ptrcall!(PoolVector2Array)(_classBinding.findPath, _godot_object, from, to); 78 } 79 /** 80 81 */ 82 PoolVector2Array getIntersections(in Vector2 from, in Vector2 to) const 83 { 84 checkClassBinding!(typeof(this))(); 85 return ptrcall!(PoolVector2Array)(_classBinding.getIntersections, _godot_object, from, to); 86 } 87 /** 88 89 */ 90 Vector2 getClosestPoint(in Vector2 point) const 91 { 92 checkClassBinding!(typeof(this))(); 93 return ptrcall!(Vector2)(_classBinding.getClosestPoint, _godot_object, point); 94 } 95 /** 96 97 */ 98 bool isPointInside(in Vector2 point) const 99 { 100 checkClassBinding!(typeof(this))(); 101 return ptrcall!(bool)(_classBinding.isPointInside, _godot_object, point); 102 } 103 /** 104 105 */ 106 void setPointPenalty(in long idx, in double penalty) 107 { 108 checkClassBinding!(typeof(this))(); 109 ptrcall!(void)(_classBinding.setPointPenalty, _godot_object, idx, penalty); 110 } 111 /** 112 113 */ 114 double getPointPenalty(in long idx) const 115 { 116 checkClassBinding!(typeof(this))(); 117 return ptrcall!(double)(_classBinding.getPointPenalty, _godot_object, idx); 118 } 119 /** 120 121 */ 122 Rect2 getBounds() const 123 { 124 checkClassBinding!(typeof(this))(); 125 return ptrcall!(Rect2)(_classBinding.getBounds, _godot_object); 126 } 127 /** 128 129 */ 130 void _setData(in Dictionary arg0) 131 { 132 Array _GODOT_args = Array.empty_array; 133 _GODOT_args.append(arg0); 134 String _GODOT_method_name = String("_set_data"); 135 this.callv(_GODOT_method_name, _GODOT_args); 136 } 137 /** 138 139 */ 140 Dictionary _getData() const 141 { 142 Array _GODOT_args = Array.empty_array; 143 String _GODOT_method_name = String("_get_data"); 144 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!Dictionary); 145 } 146 /** 147 148 */ 149 @property Dictionary data() 150 { 151 return _getData(); 152 } 153 /// ditto 154 @property void data(Dictionary v) 155 { 156 _setData(v); 157 } 158 }