(svn r27362) -Codechange: Codestyle fixes for reference var declarations, static cast type, operator methods.

This commit is contained in:
alberth
2015-08-08 10:06:24 +00:00
parent 9cadc0e150
commit b885d79f50
17 changed files with 135 additions and 135 deletions

View File

@@ -30,7 +30,7 @@ protected:
/** to access inherited path finder */
Tpf& Yapf()
{
return *static_cast<Tpf*>(this);
return *static_cast<Tpf *>(this);
}
int SlopeCost(TileIndex tile, TileIndex next_tile, Trackdir trackdir)
@@ -102,7 +102,7 @@ public:
* Calculates only the cost of given node, adds it to the parent node cost
* and stores the result into Node::m_cost member
*/
inline bool PfCalcCost(Node& n, const TrackFollower *tf)
inline bool PfCalcCost(Node &n, const TrackFollower *tf)
{
int segment_cost = 0;
uint tiles = 0;
@@ -179,11 +179,11 @@ public:
/** to access inherited path finder */
Tpf& Yapf()
{
return *static_cast<Tpf*>(this);
return *static_cast<Tpf *>(this);
}
/** Called by YAPF to detect if node ends in the desired destination */
inline bool PfDetectDestination(Node& n)
inline bool PfDetectDestination(Node &n)
{
bool bDest = IsRoadDepotTile(n.m_segment_last_tile);
return bDest;
@@ -198,7 +198,7 @@ public:
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
*/
inline bool PfCalcEstimate(Node& n)
inline bool PfCalcEstimate(Node &n)
{
n.m_estimate = n.m_cost;
return true;
@@ -242,12 +242,12 @@ protected:
/** to access inherited path finder */
Tpf& Yapf()
{
return *static_cast<Tpf*>(this);
return *static_cast<Tpf *>(this);
}
public:
/** Called by YAPF to detect if node ends in the desired destination */
inline bool PfDetectDestination(Node& n)
inline bool PfDetectDestination(Node &n)
{
return PfDetectDestinationTile(n.m_segment_last_tile, n.m_segment_last_td);
}
@@ -268,7 +268,7 @@ public:
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
*/
inline bool PfCalcEstimate(Node& n)
inline bool PfCalcEstimate(Node &n)
{
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
static const int dg_dir_to_y_offs[] = {0, 1, 0, -1};
@@ -309,7 +309,7 @@ protected:
/** to access inherited path finder */
inline Tpf& Yapf()
{
return *static_cast<Tpf*>(this);
return *static_cast<Tpf *>(this);
}
public:
@@ -319,7 +319,7 @@ public:
* reachable trackdir on the new tile creates new node, initializes it
* and adds it to the open list by calling Yapf().AddNewNode(n)
*/
inline void PfFollowNode(Node& old_node)
inline void PfFollowNode(Node &old_node)
{
TrackFollower F(Yapf().GetVehicle());
if (F.Follow(old_node.m_segment_last_tile, old_node.m_segment_last_td)) {
@@ -373,7 +373,7 @@ public:
pNode = pNode->m_parent;
}
/* return trackdir from the best origin node (one of start nodes) */
Node& best_next_node = *pNode;
Node &best_next_node = *pNode;
assert(best_next_node.GetTile() == tile);
next_trackdir = best_next_node.GetTrackdir();
}