From d7f7aa1be13c72be8b967f919e0bb2efa4adcb30 Mon Sep 17 00:00:00 2001 From: cirdan Date: Wed, 29 Jan 2014 21:15:14 +0100 Subject: [PATCH] Remove VehicleType typedefs in YAPF Typedef VehicleType is no longer necessary in YAPF classes, since each of them only deals with one vehicle type. --- src/pathfinder/yapf/yapf_base.hpp | 1 - src/pathfinder/yapf/yapf_rail.cpp | 9 ++++----- src/pathfinder/yapf/yapf_road.cpp | 9 ++++----- src/pathfinder/yapf/yapf_ship.cpp | 9 ++++----- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/pathfinder/yapf/yapf_base.hpp b/src/pathfinder/yapf/yapf_base.hpp index f8d6a3d73..1b41341be 100644 --- a/src/pathfinder/yapf/yapf_base.hpp +++ b/src/pathfinder/yapf/yapf_base.hpp @@ -49,7 +49,6 @@ public: typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::TrackFollower TrackFollower; typedef typename Types::Astar Astar; ///< our base pathfinder - typedef typename Types::VehicleType VehicleType; ///< the type of vehicle typedef typename Astar::Node Node; ///< this will be our node type typedef typename Node::Key Key; ///< key to hash tables diff --git a/src/pathfinder/yapf/yapf_rail.cpp b/src/pathfinder/yapf/yapf_rail.cpp index b9cf24d1e..8f8585c1a 100644 --- a/src/pathfinder/yapf/yapf_rail.cpp +++ b/src/pathfinder/yapf/yapf_rail.cpp @@ -123,8 +123,8 @@ public: typedef SmallArray LocalCache; protected: - const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf) - const typename Types::VehicleType *m_veh; ///< vehicle that we are trying to drive + const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf) + const Train *m_veh; ///< vehicle that we are trying to drive /** * @note maximum cost doesn't work with caching enabled @@ -205,7 +205,7 @@ public: return *m_settings; } - const typename Types::VehicleType * GetVehicle() const + const Train * GetVehicle() const { return m_veh; } @@ -871,7 +871,7 @@ cached_segment: * - or the maximum amount of loops reached - m_max_search_nodes (default = 10000) * @return true if the path was found */ - inline bool FindPath(const typename Types::VehicleType *v) + inline bool FindPath(const Train *v) { m_veh = v; @@ -1556,7 +1556,6 @@ struct CYapfRail_TypesT typedef Tpf_ Tpf; typedef Ttrack_follower TrackFollower; typedef AstarRailTrackDir Astar; - typedef Train VehicleType; }; struct CYapfRail1 diff --git a/src/pathfinder/yapf/yapf_road.cpp b/src/pathfinder/yapf/yapf_road.cpp index 5300a692a..5ca6e2ab9 100644 --- a/src/pathfinder/yapf/yapf_road.cpp +++ b/src/pathfinder/yapf/yapf_road.cpp @@ -24,8 +24,8 @@ public: typedef typename Node::Key Key; ///< key to hash tables protected: - const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf) - const typename Types::VehicleType *m_veh; ///< vehicle that we are trying to drive + const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf) + const RoadVehicle *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 @@ -56,7 +56,7 @@ protected: return *m_settings; } - const typename Types::VehicleType * GetVehicle() const + const RoadVehicle * GetVehicle() const { return m_veh; } @@ -277,7 +277,7 @@ public: * - or the maximum amount of loops reached - m_max_search_nodes (default = 10000) * @return true if the path was found */ - inline bool FindPath(const typename Types::VehicleType *v) + inline bool FindPath(const RoadVehicle *v) { m_veh = v; @@ -447,7 +447,6 @@ struct CYapfRoad_TypesT typedef Tpf_ Tpf; typedef CFollowTrackRoad TrackFollower; typedef TAstar Astar; - typedef RoadVehicle VehicleType; }; struct CYapfRoad1 diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index b27429dd3..1a603904a 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -26,8 +26,8 @@ public: typedef typename Node::Key Key; ///< key to hash tables protected: - const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf) - const typename Types::VehicleType *m_veh; ///< vehicle that we are trying to drive + const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf) + const Ship *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 @@ -62,7 +62,7 @@ protected: return *m_settings; } - const typename Types::VehicleType * GetVehicle() const + const Ship * GetVehicle() const { return m_veh; } @@ -234,7 +234,7 @@ public: * - or the maximum amount of loops reached - m_max_search_nodes (default = 10000) * @return true if the path was found */ - inline bool FindPath(const typename Types::VehicleType *v) + inline bool FindPath(const Ship *v) { m_veh = v; @@ -287,7 +287,6 @@ struct CYapfShip_TypesT typedef Ttrack_follower TrackFollower; /** node list type */ typedef TAstar Astar; - typedef Ship VehicleType; }; /* YAPF type 1 - uses TileIndex/Trackdir as Node key, allows 90-deg turns */ -- 2.11.4.GIT