13 #include "../../track_func.h"
14 #include "../../misc/dbg_helpers.h"
29 inline int CalcHash()
const
31 return this->exitdir | (this->tile.base() << 2);
36 return this->tile == other.tile && this->exitdir == other.exitdir;
49 inline int CalcHash()
const
51 return this->td | (this->tile.base() << 4);
56 return this->tile == other.tile && this->td == other.td;
61 template <
class Tkey_,
class Tnode>
75 this->key.Set(tile, td);
76 this->hash_next =
nullptr;
77 this->parent = parent;
80 this->is_choice = is_choice;
83 inline Node *GetHashNext()
85 return this->hash_next;
88 inline void SetHashNext(Node *pNext)
90 this->hash_next = pNext;
95 return this->key.tile;
103 inline const Tkey_ &GetKey()
const
108 inline int GetCost()
const
113 inline int GetCostEstimate()
const
115 return this->estimate;
118 inline bool GetIsChoice()
const
120 return this->is_choice;
123 inline bool operator<(
const Node &other)
const
125 return this->estimate < other.estimate;
DiagDirection
Enumeration for diagonal directions.
@ INVALID_DIAGDIR
Flag for an invalid DiagDirection.
Yapf Node Key that evaluates hash from (and compares) tile & exit dir.
Class that represents the dump-into-string target.
void WriteEnumT(const std::string &name, E e)
Dump given enum value (as a number and as named value)
void WriteValue(const std::string &name, int value)
Write 'name = value' with indent and new-line.
void WriteTile(const std::string &name, TileIndex t)
Write name & TileIndex to the output.
void WriteStructT(const std::string &name, const S *s)
Dump nested object (or only its name if this instance is already known).
DiagDirection TrackdirToExitdir(Trackdir trackdir)
Maps a trackdir to the (4-way) direction the tile is exited when following that trackdir.
Trackdir
Enumeration for tracks and directions.
@ INVALID_TRACKDIR
Flag for an invalid trackdir.