Rule of 5.
This commit is contained in:
@@ -138,8 +138,6 @@ MultilevelAStarEx::MultilevelAStarEx()
|
|||||||
_pass = 0;
|
_pass = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
MultilevelAStarEx::~MultilevelAStarEx() { }
|
|
||||||
|
|
||||||
void MultilevelAStarEx::init(const Rect2i ®ion)
|
void MultilevelAStarEx::init(const Rect2i ®ion)
|
||||||
{
|
{
|
||||||
DEV_ASSERT(!_init);
|
DEV_ASSERT(!_init);
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ public:
|
|||||||
UNUSED, OPEN, CLOSED
|
UNUSED, OPEN, CLOSED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Node(const Node &other) = default;
|
||||||
|
Node(Node &&other) noexcept = default;
|
||||||
|
~Node() noexcept = default;
|
||||||
|
Node& operator=(const Node &other) = default;
|
||||||
|
Node& operator=(Node &&other) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool hasUnit;
|
bool hasUnit;
|
||||||
TerrainType terrainType;
|
TerrainType terrainType;
|
||||||
@@ -50,6 +56,23 @@ class MultilevelAStarEx : public godot::RefCounted
|
|||||||
{
|
{
|
||||||
GDCLASS(MultilevelAStarEx, godot::RefCounted)
|
GDCLASS(MultilevelAStarEx, godot::RefCounted)
|
||||||
|
|
||||||
|
public:
|
||||||
|
MultilevelAStarEx();
|
||||||
|
|
||||||
|
MultilevelAStarEx(const MultilevelAStarEx &other) = delete;
|
||||||
|
MultilevelAStarEx(MultilevelAStarEx &&other) noexcept = delete;
|
||||||
|
~MultilevelAStarEx() noexcept = default;
|
||||||
|
//MultilevelAStarEx& operator=(const MultilevelAStarEx &other) = delete; // already "removed" by GDCLASS
|
||||||
|
MultilevelAStarEx& operator=(MultilevelAStarEx &&other) noexcept = delete;
|
||||||
|
|
||||||
|
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<godot::Vector2i> find_path(const godot::Vector2i &from, const godot::Vector2i &to, bool return_closest);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _init;
|
bool _init;
|
||||||
int _pass;
|
int _pass;
|
||||||
@@ -64,18 +87,6 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
public:
|
|
||||||
MultilevelAStarEx();
|
|
||||||
~MultilevelAStarEx();
|
|
||||||
|
|
||||||
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<godot::Vector2i> find_path(const godot::Vector2i &from, const godot::Vector2i &to, bool return_closest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VARIANT_ENUM_CAST(TerrainType);
|
VARIANT_ENUM_CAST(TerrainType);
|
||||||
|
|||||||
Reference in New Issue
Block a user