diff options
author | KUDr <kudr@openttd.org> | 2006-05-29 18:39:42 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-05-29 18:39:42 +0000 |
commit | ed48b38619492a4018ac014d203718db689f69b2 (patch) | |
tree | cca7f9d507723ce078f410649f6ba598ccdb0523 /yapf/yapf_costrail.hpp | |
parent | 301f4ac856088ac32f89b791479fbb0dfb4f911b (diff) | |
download | openttd-ed48b38619492a4018ac014d203718db689f69b2.tar.xz |
(svn r5018) [YAPF] Added some comments to YAPF implementation.
Diffstat (limited to 'yapf/yapf_costrail.hpp')
-rw-r--r-- | yapf/yapf_costrail.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/yapf/yapf_costrail.hpp b/yapf/yapf_costrail.hpp index 3c01e47d0..d8ebe3f5e 100644 --- a/yapf/yapf_costrail.hpp +++ b/yapf/yapf_costrail.hpp @@ -10,10 +10,10 @@ class CYapfCostRailT , public CostRailSettings { public: - typedef typename Types::Tpf Tpf; + typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class) typedef typename Types::TrackFollower TrackFollower; typedef typename Types::NodeList::Titem Node; ///< this will be our node type - typedef typename Node::Key Key; ///< key to hash tables + typedef typename Node::Key Key; ///< key to hash tables typedef typename Node::CachedData CachedData; protected: @@ -33,6 +33,7 @@ protected: pen[i] = p0 + i * (p1 + i * p2); } + /// to access inherited path finder Tpf& Yapf() {return *static_cast<Tpf*>(this);} public: @@ -140,6 +141,9 @@ public: public: FORCEINLINE void SetMaxCost(int max_cost) {m_max_cost = max_cost;} + /** Called by YAPF to calculate the cost from the origin to the given node. + * Calculates only the cost of given node, adds it to the parent node cost + * and stores the result into Node::m_cost member */ FORCEINLINE bool PfCalcCost(Node& n) { assert(!n.flags_u.flags_s.m_targed_seen); |