From d6d22806761b1c4af1157001662191a7341cad5c Mon Sep 17 00:00:00 2001 From: Katja Date: Thu, 6 Jun 2024 02:58:32 +0200 Subject: [PATCH] Removed from namespace godot. --- src/MultilevelAStarEx.h | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/MultilevelAStarEx.h b/src/MultilevelAStarEx.h index a91d5f0..bed0d39 100644 --- a/src/MultilevelAStarEx.h +++ b/src/MultilevelAStarEx.h @@ -8,8 +8,6 @@ #include -namespace godot { - enum TerrainType : int { STAIRS = -1, @@ -42,7 +40,7 @@ private: static bool compare_nodes(const Node *left, const Node *right); Node(int x, int y); - void open(int pass, Node *parent, int distanceFromStart, const Vector2i &end); + void open(int pass, Node *parent, int distanceFromStart, const godot::Vector2i &end); void close(int pass); NodeState state(int pass) const; int total_cost() const; @@ -51,21 +49,21 @@ public: Node(); }; -class MultilevelAStarEx : public RefCounted +class MultilevelAStarEx : public godot::RefCounted { - GDCLASS(MultilevelAStarEx, RefCounted) + GDCLASS(MultilevelAStarEx, godot::RefCounted) private: bool _init; int _pass; std::vector _nodes; - Rect2i _region; - Vector2i _trans; + godot::Rect2i _region; + godot::Vector2i _trans; int _width, _height; bool can_move(const Node *current, int x, int y) const; - TypedArray generate_path(const Node *current) const; + godot::TypedArray generate_path(const Node *current) const; protected: static void _bind_methods(); @@ -74,17 +72,15 @@ public: MultilevelAStarEx(); ~MultilevelAStarEx(); - void init(const Rect2i ®ion); - Rect2i get_region() const; - void set_terrain(const Vector2i &cell, TerrainType type); - TerrainType get_terrain(const Vector2i &cell) const; - void set_unit(const Vector2i &cell, bool blocked); - bool get_unit(const Vector2i &cell) const; - TypedArray find_path(const Vector2i &from, const Vector2i &to, bool return_closest); + void init(const godot::Rect2i ®ion); + godot::Rect2i get_region() const; + void set_terrain(const godot::Vector2i &cell, TerrainType type); + TerrainType get_terrain(const godot::Vector2i &cell) const; + void set_unit(const godot::Vector2i &cell, bool blocked); + bool get_unit(const godot::Vector2i &cell) const; + godot::TypedArray find_path(const godot::Vector2i &from, const godot::Vector2i &to, bool return_closest); }; -} - VARIANT_ENUM_CAST(TerrainType); #endif \ No newline at end of file