diff options
Diffstat (limited to 'core/math/a_star.h')
-rw-r--r-- | core/math/a_star.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/math/a_star.h b/core/math/a_star.h index bfcf0c09d3..8c10ace33c 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef ASTAR_H -#define ASTAR_H +#ifndef A_STAR_H +#define A_STAR_H #include "core/oa_hash_map.h" #include "core/reference.h" @@ -43,6 +43,7 @@ class AStar : public Reference { GDCLASS(AStar, Reference); + friend class AStar2D; struct Point { @@ -124,8 +125,8 @@ class AStar : public Reference { protected: static void _bind_methods(); - virtual float _estimate_cost(int p_from_id, int p_to_id); - virtual float _compute_cost(int p_from_id, int p_to_id); + virtual real_t _estimate_cost(int p_from_id, int p_to_id); + virtual real_t _compute_cost(int p_from_id, int p_to_id); public: int get_available_point_id() const; @@ -166,9 +167,14 @@ class AStar2D : public Reference { GDCLASS(AStar2D, Reference); AStar astar; + bool _solve(AStar::Point *begin_point, AStar::Point *end_point); + protected: static void _bind_methods(); + virtual real_t _estimate_cost(int p_from_id, int p_to_id); + virtual real_t _compute_cost(int p_from_id, int p_to_id); + public: int get_available_point_id() const; @@ -204,4 +210,4 @@ public: ~AStar2D(); }; -#endif // ASTAR_H +#endif // A_STAR_H |