summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-02 16:14:23 +0000
committerrubidium <rubidium@openttd.org>2011-05-02 16:14:23 +0000
commit4d5dbf51707c42c24eeafdb65016b079c54adcf2 (patch)
tree0197dcc17f4a8411ecea2223f356019c902fe7b9 /src/pathfinder/yapf
parente9837ff1ec1326aec622366ae29ff1aa81581daf (diff)
downloadopenttd-4d5dbf51707c42c24eeafdb65016b079c54adcf2.tar.xz
(svn r22410) -Document: some more bits ;)
Diffstat (limited to 'src/pathfinder/yapf')
-rw-r--r--src/pathfinder/yapf/nodelist.hpp3
-rw-r--r--src/pathfinder/yapf/yapf.h2
-rw-r--r--src/pathfinder/yapf/yapf_costbase.hpp12
-rw-r--r--src/pathfinder/yapf/yapf_costrail.hpp1
4 files changed, 11 insertions, 7 deletions
diff --git a/src/pathfinder/yapf/nodelist.hpp b/src/pathfinder/yapf/nodelist.hpp
index 6a197f98d..b81fd65e0 100644
--- a/src/pathfinder/yapf/nodelist.hpp
+++ b/src/pathfinder/yapf/nodelist.hpp
@@ -151,9 +151,12 @@ public:
return item;
}
+ /** The number of items. */
FORCEINLINE int TotalCount() {return m_arr.Length();}
+ /** Get a particular item. */
FORCEINLINE Titem_& ItemAt(int idx) {return m_arr[idx];}
+ /** Helper for creating output of this array. */
template <class D> void Dump(D &dmp) const
{
dmp.WriteStructT("m_arr", &m_arr);
diff --git a/src/pathfinder/yapf/yapf.h b/src/pathfinder/yapf/yapf.h
index 37b3bf41e..b02d9d0ee 100644
--- a/src/pathfinder/yapf/yapf.h
+++ b/src/pathfinder/yapf/yapf.h
@@ -65,7 +65,7 @@ FindDepotData YapfRoadVehicleFindNearestDepot(const RoadVehicle *v, int max_pena
/**
* Used when user sends train to the nearest depot or if train needs servicing using YAPF.
* @param v train that needs to go to some depot
- * @param max_penalty max distance (int pathfinder penalty) from the current train position
+ * @param max_distance max distance (int pathfinder penalty) from the current train position
* (used also as optimization - the pathfinder can stop path finding if max_penalty
* was reached and no depot was seen)
* @return the data about the depot
diff --git a/src/pathfinder/yapf/yapf_costbase.hpp b/src/pathfinder/yapf/yapf_costbase.hpp
index 29d6c85c2..057c0ae5b 100644
--- a/src/pathfinder/yapf/yapf_costbase.hpp
+++ b/src/pathfinder/yapf/yapf_costbase.hpp
@@ -12,7 +12,14 @@
#ifndef YAPF_COSTBASE_HPP
#define YAPF_COSTBASE_HPP
+/** Base implementation for cost accounting. */
struct CYapfCostBase {
+ /**
+ * Does the given track direction on the given tile yeild an uphill penalty?
+ * @param tile The tile to check.
+ * @param td The track direction to check.
+ * @return True if there's a slope, otherwise false.
+ */
FORCEINLINE static bool stSlopeCost(TileIndex tile, Trackdir td)
{
if (IsDiagonalTrackdir(td)) {
@@ -34,9 +41,4 @@ struct CYapfCostBase {
}
};
-struct CostRailSettings {
- /* look-ahead signal penalty */
-};
-
-
#endif /* YAPF_COSTBASE_HPP */
diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp
index 0cee47699..f1b6565f2 100644
--- a/src/pathfinder/yapf/yapf_costrail.hpp
+++ b/src/pathfinder/yapf/yapf_costrail.hpp
@@ -17,7 +17,6 @@
template <class Types>
class CYapfCostRailT
: public CYapfCostBase
- , public CostRailSettings
{
public:
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)