Add: Road vehicle path cache. (#7261)

This commit is contained in:
PeterN
2019-03-08 23:52:45 +00:00
committed by GitHub
parent dae35188ab
commit 6c6971fb43
9 changed files with 107 additions and 23 deletions

View File

@@ -67,6 +67,7 @@ struct CYapfNodeT {
Node *m_parent;
int m_cost;
int m_estimate;
bool m_is_choice;
inline void Set(Node *parent, TileIndex tile, Trackdir td, bool is_choice)
{
@@ -75,6 +76,7 @@ struct CYapfNodeT {
m_parent = parent;
m_cost = 0;
m_estimate = 0;
m_is_choice = is_choice;
}
inline Node *GetHashNext()
@@ -112,6 +114,11 @@ struct CYapfNodeT {
return m_estimate;
}
inline bool GetIsChoice() const
{
return m_is_choice;
}
inline bool operator<(const Node &other) const
{
return m_estimate < other.m_estimate;