summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf/yapf_node.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pathfinder/yapf/yapf_node.hpp')
-rw-r--r--src/pathfinder/yapf/yapf_node.hpp69
1 files changed, 57 insertions, 12 deletions
diff --git a/src/pathfinder/yapf/yapf_node.hpp b/src/pathfinder/yapf/yapf_node.hpp
index c305fd996..b3021096b 100644
--- a/src/pathfinder/yapf/yapf_node.hpp
+++ b/src/pathfinder/yapf/yapf_node.hpp
@@ -25,8 +25,15 @@ struct CYapfNodeKeyExitDir {
m_exitdir = (m_td == INVALID_TRACKDIR) ? INVALID_DIAGDIR : TrackdirToExitdir(m_td);
}
- inline int CalcHash() const {return m_exitdir | (m_tile << 2);}
- inline bool operator==(const CYapfNodeKeyExitDir &other) const {return (m_tile == other.m_tile) && (m_exitdir == other.m_exitdir);}
+ inline int CalcHash() const
+ {
+ return m_exitdir | (m_tile << 2);
+ }
+
+ inline bool operator==(const CYapfNodeKeyExitDir &other) const
+ {
+ return m_tile == other.m_tile && m_exitdir == other.m_exitdir;
+ }
void Dump(DumpTarget &dmp) const
{
@@ -38,8 +45,15 @@ struct CYapfNodeKeyExitDir {
struct CYapfNodeKeyTrackDir : public CYapfNodeKeyExitDir
{
- inline int CalcHash() const {return m_td | (m_tile << 4);}
- inline bool operator==(const CYapfNodeKeyTrackDir &other) const {return (m_tile == other.m_tile) && (m_td == other.m_td);}
+ inline int CalcHash() const
+ {
+ return m_td | (m_tile << 4);
+ }
+
+ inline bool operator==(const CYapfNodeKeyTrackDir &other) const
+ {
+ return m_tile == other.m_tile && m_td == other.m_td;
+ }
};
/** Yapf Node base */
@@ -63,14 +77,45 @@ struct CYapfNodeT {
m_estimate = 0;
}
- inline Node *GetHashNext() {return m_hash_next;}
- inline void SetHashNext(Node *pNext) {m_hash_next = pNext;}
- inline TileIndex GetTile() const {return m_key.m_tile;}
- inline Trackdir GetTrackdir() const {return m_key.m_td;}
- inline const Tkey_& GetKey() const {return m_key;}
- inline int GetCost() const {return m_cost;}
- inline int GetCostEstimate() const {return m_estimate;}
- inline bool operator<(const Node &other) const {return m_estimate < other.m_estimate;}
+ inline Node *GetHashNext()
+ {
+ return m_hash_next;
+ }
+
+ inline void SetHashNext(Node *pNext)
+ {
+ m_hash_next = pNext;
+ }
+
+ inline TileIndex GetTile() const
+ {
+ return m_key.m_tile;
+ }
+
+ inline Trackdir GetTrackdir() const
+ {
+ return m_key.m_td;
+ }
+
+ inline const Tkey_& GetKey() const
+ {
+ return m_key;
+ }
+
+ inline int GetCost() const
+ {
+ return m_cost;
+ }
+
+ inline int GetCostEstimate() const
+ {
+ return m_estimate;
+ }
+
+ inline bool operator<(const Node &other) const
+ {
+ return m_estimate < other.m_estimate;
+ }
void Dump(DumpTarget &dmp) const
{