summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf/yapf_base.hpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-02 10:13:49 +0000
committerrubidium <rubidium@openttd.org>2009-12-02 10:13:49 +0000
commitc56c892b2c9a30d7a5d4e7a59053e13471f038ab (patch)
tree4bc147441da298b187778958ec6853644c9ef907 /src/pathfinder/yapf/yapf_base.hpp
parent9165c195b9609bb9db77cc23ff424802eb4ab128 (diff)
downloadopenttd-c56c892b2c9a30d7a5d4e7a59053e13471f038ab.tar.xz
(svn r18372) -Codechange: push some extra type safety into YAPF
Diffstat (limited to 'src/pathfinder/yapf/yapf_base.hpp')
-rw-r--r--src/pathfinder/yapf/yapf_base.hpp7
1 files changed, 4 insertions, 3 deletions
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;
}