summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf/yapf_base.hpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2015-08-08 10:06:24 +0000
committeralberth <alberth@openttd.org>2015-08-08 10:06:24 +0000
commitb885d79f506bde93b4ab278b3f84b8ca6254f3b9 (patch)
treeed7e027c4444181baab5b4ef6b667cd179f29a65 /src/pathfinder/yapf/yapf_base.hpp
parent9cadc0e1504cf979c14e1cb42bfe51a29675dd81 (diff)
downloadopenttd-b885d79f506bde93b4ab278b3f84b8ca6254f3b9.tar.xz
(svn r27362) -Codechange: Codestyle fixes for reference var declarations, static cast type, operator methods.
Diffstat (limited to 'src/pathfinder/yapf/yapf_base.hpp')
-rw-r--r--src/pathfinder/yapf/yapf_base.hpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/pathfinder/yapf/yapf_base.hpp b/src/pathfinder/yapf/yapf_base.hpp
index 0f88d058e..713e3755a 100644
--- a/src/pathfinder/yapf/yapf_base.hpp
+++ b/src/pathfinder/yapf/yapf_base.hpp
@@ -38,10 +38,10 @@ extern int _total_pf_time_us;
* --------------------------------------------------------------
* Your pathfinder derived class needs to implement following methods:
* inline void PfSetStartupNodes()
- * inline void PfFollowNode(Node& org)
- * inline bool PfCalcCost(Node& n)
- * inline bool PfCalcEstimate(Node& n)
- * inline bool PfDetectDestination(Node& n)
+ * inline void PfFollowNode(Node &org)
+ * inline bool PfCalcCost(Node &n)
+ * inline bool PfCalcEstimate(Node &n)
+ * inline bool PfDetectDestination(Node &n)
*
* For more details about those methods, look at the end of CYapfBaseT
* declaration. There are some examples. For another example look at
@@ -99,7 +99,7 @@ protected:
/** to access inherited path finder */
inline Tpf& Yapf()
{
- return *static_cast<Tpf*>(this);
+ return *static_cast<Tpf *>(this);
}
public:
@@ -193,12 +193,12 @@ public:
*/
inline Node& CreateNewNode()
{
- Node& node = *m_nodes.CreateNewNode();
+ Node &node = *m_nodes.CreateNewNode();
return node;
}
/** Add new node (created by CreateNewNode and filled with data) into open list */
- inline void AddStartupNode(Node& n)
+ inline void AddStartupNode(Node &n)
{
Yapf().PfNodeCacheFetch(n);
/* insert the new node only if it is not there */
@@ -217,7 +217,7 @@ public:
bool is_choice = (KillFirstBit(tf.m_new_td_bits) != TRACKDIR_BIT_NONE);
for (TrackdirBits rtds = tf.m_new_td_bits; rtds != TRACKDIR_BIT_NONE; rtds = KillFirstBit(rtds)) {
Trackdir td = (Trackdir)FindFirstBit2x64(rtds);
- Node& n = Yapf().CreateNewNode();
+ Node &n = Yapf().CreateNewNode();
n.Set(parent, tf.m_new_tile, td, is_choice);
Yapf().AddNewNode(n, tf);
}
@@ -333,7 +333,7 @@ public:
inline void PfSetStartupNodes()
{
/* example: */
- Node& n1 = *base::m_nodes.CreateNewNode();
+ Node &n1 = *base::m_nodes.CreateNewNode();
.
. // setup node members here
.
@@ -341,10 +341,10 @@ public:
}
/** Example: PfFollowNode() - set following (child) nodes of the given node */
- inline void PfFollowNode(Node& org)
+ inline void PfFollowNode(Node &org)
{
for (each follower of node org) {
- Node& n = *base::m_nodes.CreateNewNode();
+ Node &n = *base::m_nodes.CreateNewNode();
.
. // setup node members here
.
@@ -354,7 +354,7 @@ public:
}
/** Example: PfCalcCost() - set path cost from origin to the given node */
- inline bool PfCalcCost(Node& n)
+ inline bool PfCalcCost(Node &n)
{
/* evaluate last step cost */
int cost = ...;
@@ -364,7 +364,7 @@ public:
}
/** Example: PfCalcEstimate() - set path cost estimate from origin to the target through given node */
- inline bool PfCalcEstimate(Node& n)
+ inline bool PfCalcEstimate(Node &n)
{
/* evaluate the distance to our destination */
int distance = ...;
@@ -374,7 +374,7 @@ public:
}
/** Example: PfDetectDestination() - return true if the given node is our destination */
- inline bool PfDetectDestination(Node& n)
+ inline bool PfDetectDestination(Node &n)
{
bool bDest = (n.m_key.m_x == m_x2) && (n.m_key.m_y == m_y2);
return bDest;