File diff r18781:e1de9a06f7cd → r18782:6453522c2154
src/pathfinder/yapf/yapf_ship.cpp
Show inline comments
 
@@ -24,13 +24,13 @@ public:
 
	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
 

	
 
protected:
 
	/** to access inherited path finder */
 
	FORCEINLINE Tpf& Yapf()
 
	inline Tpf& Yapf()
 
	{
 
		return *static_cast<Tpf*>(this);
 
	}
 

	
 
public:
 
	/**
 
@@ -44,13 +44,13 @@ public:
 
		if (F.Follow(old_node.m_key.m_tile, old_node.m_key.m_td)) {
 
			Yapf().AddMultipleNodes(&old_node, F);
 
		}
 
	}
 

	
 
	/** return debug report character to identify the transportation type */
 
	FORCEINLINE char TransportTypeChar() const
 
	inline char TransportTypeChar() const
 
	{
 
		return 'w';
 
	}
 

	
 
	static Trackdir ChooseShipTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found)
 
	{
 
@@ -120,13 +120,13 @@ protected:
 
public:
 
	/**
 
	 * 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, const TrackFollower *tf)
 
	inline bool PfCalcCost(Node& n, const TrackFollower *tf)
 
	{
 
		/* base tile cost depending on distance */
 
		int c = IsDiagonalTrackdir(n.GetTrackdir()) ? YAPF_TILE_LENGTH : YAPF_TILE_CORNER_LENGTH;
 
		/* additional penalty for curves */
 
		if (n.m_parent != NULL && n.GetTrackdir() != NextTrackdir(n.m_parent->GetTrackdir())) {
 
			/* new trackdir does not match the next one when going straight */