From c56c892b2c9a30d7a5d4e7a59053e13471f038ab Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 2 Dec 2009 10:13:49 +0000 Subject: (svn r18372) -Codechange: push some extra type safety into YAPF --- src/pathfinder/yapf/yapf_base.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/pathfinder/yapf/yapf_base.hpp') diff --git a/src/pathfinder/yapf/yapf_base.hpp b/src/pathfinder/yapf/yapf_base.hpp index 0011e0802..cbebb31ec 100644 --- a/src/pathfinder/yapf/yapf_base.hpp +++ b/src/pathfinder/yapf/yapf_base.hpp @@ -52,6 +52,7 @@ public: typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::TrackFollower TrackFollower; typedef typename Types::NodeList NodeList; ///< our node list + typedef typename Types::VehicleType VehicleType; ///< the type of vehicle typedef typename NodeList::Titem Node; ///< this will be our node type typedef typename Node::Key Key; ///< key to hash tables @@ -62,7 +63,7 @@ protected: Node *m_pBestIntermediateNode; ///< here should be node closest to the destination if path not found const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf) int m_max_search_nodes; ///< maximum number of nodes we are allowed to visit before we give up - const Vehicle *m_veh; ///< vehicle that we are trying to drive + const VehicleType *m_veh; ///< vehicle that we are trying to drive int m_stats_cost_calcs; ///< stats - how many node's costs were calculated int m_stats_cache_hits; ///< stats - how many node's costs were reused from cache @@ -114,7 +115,7 @@ public: * - or the open list is empty (no route to destination). * - or the maximum amount of loops reached - m_max_search_nodes (default = 10000) * @return true if the path was found */ - inline bool FindPath(const Vehicle *v) + inline bool FindPath(const VehicleType *v) { m_veh = v; @@ -291,7 +292,7 @@ public: m_nodes.InsertOpenNode(n); } - const Vehicle * GetVehicle() const + const VehicleType * GetVehicle() const { return m_veh; } -- cgit v1.2.3-54-g00ecf