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;
48 inline int CalcHash()
const
50 return this->td | (this->tile.base() << 4);
55 return this->tile == other.tile && this->td == other.td;
60template <
class Tkey_,
class Tnode>
74 this->key.Set(tile, td);
75 this->hash_next =
nullptr;
76 this->parent = parent;
79 this->is_choice = is_choice;
82 inline Node *GetHashNext()
84 return this->hash_next;
87 inline void SetHashNext(Node *pNext)
89 this->hash_next = pNext;
94 return this->key.tile;
102 inline const Tkey_ &GetKey()
const
107 inline int GetCost()
const
112 inline int GetCostEstimate()
const
114 return this->estimate;
117 inline bool GetIsChoice()
const
119 return this->is_choice;
122 inline bool operator<(
const Node &other)
const
124 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 WriteTile(std::string_view name, TileIndex t)
Write name & TileIndex to the output.
void WriteStructT(std::string_view name, const S *s)
Dump nested object (or only its name if this instance is already known).
void WriteEnumT(std::string_view name, E e)
Dump given enum value (as a number and as named value)
void WriteValue(std::string_view name, const auto &value)
Write 'name = value' with indent and new-line.
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.