mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Cleaned up and renamed NodeList
parent
bbc1f7b3dc
commit
3e195df3c7
|
@ -25,11 +25,11 @@
|
|||
void AyStar::OpenListAdd(PathNode *parent, const AyStarNode *node, int f, int g)
|
||||
{
|
||||
/* Add a new Node to the OpenList */
|
||||
PathNode *new_node = this->nodes.CreateNewNode();
|
||||
new_node->Set(parent, node->tile, node->td, true);
|
||||
new_node->estimate = f;
|
||||
new_node->cost = g;
|
||||
this->nodes.InsertOpenNode(*new_node);
|
||||
PathNode &new_node = this->nodes.CreateNewNode();
|
||||
new_node.Set(parent, node->tile, node->td, true);
|
||||
new_node.estimate = f;
|
||||
new_node.cost = g;
|
||||
this->nodes.InsertOpenNode(new_node);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -136,7 +136,7 @@ struct AyStar {
|
|||
void CheckTile(AyStarNode *current, PathNode *parent);
|
||||
|
||||
protected:
|
||||
CNodeList_HashTableT<PathNode, 8, 10> nodes;
|
||||
NodeList<PathNode, 8, 10> nodes;
|
||||
|
||||
void OpenListAdd(PathNode *parent, const AyStarNode *node, int f, int g);
|
||||
};
|
||||
|
|
|
@ -15,38 +15,28 @@
|
|||
|
||||
/**
|
||||
* Hash table based node list multi-container class.
|
||||
* Implements open list, closed list and priority queue for A-star
|
||||
* path finder.
|
||||
* Implements open list, closed list and priority queue for A-star pathfinder.
|
||||
*/
|
||||
template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_>
|
||||
class CNodeList_HashTableT {
|
||||
template <class Titem, int Thash_bits_open, int Thash_bits_closed>
|
||||
class NodeList {
|
||||
public:
|
||||
typedef Titem_ Titem; ///< Make #Titem_ visible from outside of class.
|
||||
typedef typename Titem_::Key Key; ///< Make Titem_::Key a property of this class.
|
||||
using CItemArray = std::deque<Titem_>; ///< Type that we will use as item container.
|
||||
typedef HashTable<Titem_, Thash_bits_open_ > COpenList; ///< How pointers to open nodes will be stored.
|
||||
typedef HashTable<Titem_, Thash_bits_closed_> CClosedList; ///< How pointers to closed nodes will be stored.
|
||||
typedef CBinaryHeapT<Titem_> CPriorityQueue; ///< How the priority queue will be managed.
|
||||
using Item = Titem;
|
||||
using Key = typename Titem::Key;
|
||||
|
||||
protected:
|
||||
CItemArray items; ///< Here we store full item data (Titem_).
|
||||
COpenList open_nodes; ///< Hash table of pointers to open item data.
|
||||
CClosedList closed_nodes; ///< Hash table of pointers to closed item data.
|
||||
CPriorityQueue open_queue; ///< Priority queue of pointers to open item data.
|
||||
Titem *new_node; ///< New open node under construction.
|
||||
std::deque<Titem> items; ///< Storage of the nodes.
|
||||
HashTable<Titem, Thash_bits_open> open_nodes; ///< Hash table of pointers to open nodes.
|
||||
HashTable<Titem, Thash_bits_closed> closed_nodes; ///< Hash table of pointers to closed nodes.
|
||||
CBinaryHeapT<Titem> open_queue; ///< Priority queue of pointers to open nodes.
|
||||
Titem *new_node; ///< New node under construction.
|
||||
|
||||
public:
|
||||
/** default constructor */
|
||||
CNodeList_HashTableT() : open_queue(2048)
|
||||
NodeList() : open_queue(2048)
|
||||
{
|
||||
this->new_node = nullptr;
|
||||
}
|
||||
|
||||
/** destructor */
|
||||
~CNodeList_HashTableT()
|
||||
{
|
||||
}
|
||||
|
||||
/** return number of open nodes */
|
||||
inline int OpenCount()
|
||||
{
|
||||
|
@ -59,15 +49,21 @@ public:
|
|||
return this->closed_nodes.Count();
|
||||
}
|
||||
|
||||
/** return the total number of nodes. */
|
||||
inline int TotalCount()
|
||||
{
|
||||
return this->items.Length();
|
||||
}
|
||||
|
||||
/** allocate new data item from items */
|
||||
inline Titem_ *CreateNewNode()
|
||||
inline Titem &CreateNewNode()
|
||||
{
|
||||
if (this->new_node == nullptr) this->new_node = &this->items.emplace_back();
|
||||
return this->new_node;
|
||||
return *this->new_node;
|
||||
}
|
||||
|
||||
/** Notify the nodelist that we don't want to discard the given node. */
|
||||
inline void FoundBestNode(Titem_ &item)
|
||||
inline void FoundBestNode(Titem &item)
|
||||
{
|
||||
/* for now it is enough to invalidate m_new_node if it is our given node */
|
||||
if (&item == this->new_node) {
|
||||
|
@ -77,7 +73,7 @@ public:
|
|||
}
|
||||
|
||||
/** insert given item as open node (into m_open and m_open_queue) */
|
||||
inline void InsertOpenNode(Titem_ &item)
|
||||
inline void InsertOpenNode(Titem &item)
|
||||
{
|
||||
assert(this->closed_nodes.Find(item.GetKey()) == nullptr);
|
||||
this->open_nodes.Push(item);
|
||||
|
@ -88,7 +84,7 @@ public:
|
|||
}
|
||||
|
||||
/** return the best open node */
|
||||
inline Titem_ *GetBestOpenNode()
|
||||
inline Titem *GetBestOpenNode()
|
||||
{
|
||||
if (!this->open_queue.IsEmpty()) {
|
||||
return this->open_queue.Begin();
|
||||
|
@ -97,10 +93,10 @@ public:
|
|||
}
|
||||
|
||||
/** remove and return the best open node */
|
||||
inline Titem_ *PopBestOpenNode()
|
||||
inline Titem *PopBestOpenNode()
|
||||
{
|
||||
if (!this->open_queue.IsEmpty()) {
|
||||
Titem_ *item = this->open_queue.Shift();
|
||||
Titem *item = this->open_queue.Shift();
|
||||
this->open_nodes.Pop(*item);
|
||||
return item;
|
||||
}
|
||||
|
@ -108,49 +104,42 @@ public:
|
|||
}
|
||||
|
||||
/** return the open node specified by a key or nullptr if not found */
|
||||
inline Titem_ *FindOpenNode(const Key &key)
|
||||
inline Titem *FindOpenNode(const Key &key)
|
||||
{
|
||||
Titem_ *item = this->open_nodes.Find(key);
|
||||
return item;
|
||||
return this->open_nodes.Find(key);
|
||||
}
|
||||
|
||||
/** remove and return the open node specified by a key */
|
||||
inline Titem_ &PopOpenNode(const Key &key)
|
||||
inline Titem &PopOpenNode(const Key &key)
|
||||
{
|
||||
Titem_ &item = this->open_nodes.Pop(key);
|
||||
size_t idxPop = this->open_queue.FindIndex(item);
|
||||
this->open_queue.Remove(idxPop);
|
||||
Titem &item = this->open_nodes.Pop(key);
|
||||
size_t index = this->open_queue.FindIndex(item);
|
||||
this->open_queue.Remove(index);
|
||||
return item;
|
||||
}
|
||||
|
||||
/** close node */
|
||||
inline void InsertClosedNode(Titem_ &item)
|
||||
inline void InsertClosedNode(Titem &item)
|
||||
{
|
||||
assert(this->open_nodes.Find(item.GetKey()) == nullptr);
|
||||
this->closed_nodes.Push(item);
|
||||
}
|
||||
|
||||
/** return the closed node specified by a key or nullptr if not found */
|
||||
inline Titem_ *FindClosedNode(const Key &key)
|
||||
inline Titem *FindClosedNode(const Key &key)
|
||||
{
|
||||
Titem_ *item = this->closed_nodes.Find(key);
|
||||
return item;
|
||||
}
|
||||
|
||||
/** The number of items. */
|
||||
inline int TotalCount()
|
||||
{
|
||||
return this->items.Length();
|
||||
return this->closed_nodes.Find(key);
|
||||
}
|
||||
|
||||
/** Get a particular item. */
|
||||
inline Titem_ &ItemAt(int idx)
|
||||
inline Titem &ItemAt(int index)
|
||||
{
|
||||
return this->items[idx];
|
||||
return this->items[index];
|
||||
}
|
||||
|
||||
/** Helper for creating output of this array. */
|
||||
template <class D> void Dump(D &dmp) const
|
||||
template <class D>
|
||||
void Dump(D &dmp) const
|
||||
{
|
||||
dmp.WriteStructT("data", &this->items);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* NodeList needs to have defined local type Titem - defines the pathfinder node type.
|
||||
* Node needs to define local type Key - the node key in the collection ()
|
||||
*
|
||||
* For node list you can use template class CNodeList_HashTableT, for which
|
||||
* For node list you can use template class NodeList, for which
|
||||
* you need to declare only your node type. Look at test_yapf.h for an example.
|
||||
*
|
||||
*
|
||||
|
@ -48,13 +48,12 @@
|
|||
template <class Types>
|
||||
class CYapfBaseT {
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::TrackFollower TrackFollower;
|
||||
typedef typename Types::NodeList NodeList; ///< our node list
|
||||
typedef typename Types::VehicleType VehicleType; ///< the type of vehicle
|
||||
typedef typename NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
typedef typename NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
NodeList nodes; ///< node list multi-container
|
||||
|
||||
|
@ -156,7 +155,7 @@ public:
|
|||
*/
|
||||
inline Node &CreateNewNode()
|
||||
{
|
||||
Node &node = *this->nodes.CreateNewNode();
|
||||
Node &node = this->nodes.CreateNewNode();
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ template <class Types>
|
|||
class CYapfOriginTileT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
TileIndex origin_tile; ///< origin tile
|
||||
|
@ -62,9 +62,9 @@ template <class Types>
|
|||
class CYapfOriginTileTwoWayT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
TileIndex origin_tile; ///< first origin tile
|
||||
|
@ -120,9 +120,9 @@ template <class Types>
|
|||
class CYapfDestinationTileT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
TileIndex dest_tile; ///< destination tile
|
||||
|
|
|
@ -24,8 +24,8 @@ template <class Types>
|
|||
class CYapfSegmentCostCacheNoneT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
|
||||
/**
|
||||
* Called by YAPF to attach cached or local segment cost data to the given node.
|
||||
|
@ -105,9 +105,9 @@ struct CSegmentCostCacheT : public CSegmentCostCacheBase {
|
|||
template <class Types>
|
||||
class CYapfSegmentCostCacheGlobalT {
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Node::CachedData CachedData;
|
||||
typedef typename CachedData::Key CacheKey;
|
||||
typedef CSegmentCostCacheT<CachedData> Cache;
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
template <class Types>
|
||||
class CYapfCostRailT : public CYapfCostBase {
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
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
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Node::CachedData CachedData;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -39,9 +39,9 @@ public:
|
|||
template <class Types>
|
||||
class CYapfDestinationAnyDepotRailT : public CYapfDestinationRailBase {
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
/** to access inherited path finder */
|
||||
Tpf &Yapf()
|
||||
|
@ -75,9 +75,9 @@ public:
|
|||
template <class Types>
|
||||
class CYapfDestinationAnySafeTileRailT : public CYapfDestinationRailBase {
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::TrackFollower TrackFollower; ///< TrackFollower. Need to typedef for gcc 2.95
|
||||
|
||||
/** to access inherited path finder */
|
||||
|
@ -113,9 +113,9 @@ public:
|
|||
template <class Types>
|
||||
class CYapfDestinationTileOrStationRailT : public CYapfDestinationRailBase {
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
TileIndex dest_tile;
|
||||
|
|
|
@ -215,7 +215,7 @@ typedef CYapfRailNodeT<CYapfNodeKeyExitDir> CYapfRailNodeExitDir;
|
|||
typedef CYapfRailNodeT<CYapfNodeKeyTrackDir> CYapfRailNodeTrackDir;
|
||||
|
||||
/* Default NodeList types */
|
||||
typedef CNodeList_HashTableT<CYapfRailNodeExitDir , 8, 10> CRailNodeListExitDir;
|
||||
typedef CNodeList_HashTableT<CYapfRailNodeTrackDir, 8, 10> CRailNodeListTrackDir;
|
||||
typedef NodeList<CYapfRailNodeExitDir , 8, 10> CRailNodeListExitDir;
|
||||
typedef NodeList<CYapfRailNodeTrackDir, 8, 10> CRailNodeListTrackDir;
|
||||
|
||||
#endif /* YAPF_NODE_RAIL_HPP */
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef CYapfRoadNodeT<CYapfNodeKeyExitDir> CYapfRoadNodeExitDir;
|
|||
typedef CYapfRoadNodeT<CYapfNodeKeyTrackDir> CYapfRoadNodeTrackDir;
|
||||
|
||||
/* Default NodeList types */
|
||||
typedef CNodeList_HashTableT<CYapfRoadNodeExitDir , 8, 10> CRoadNodeListExitDir;
|
||||
typedef CNodeList_HashTableT<CYapfRoadNodeTrackDir, 8, 10> CRoadNodeListTrackDir;
|
||||
typedef NodeList<CYapfRoadNodeExitDir , 8, 10> CRoadNodeListExitDir;
|
||||
typedef NodeList<CYapfRoadNodeTrackDir, 8, 10> CRoadNodeListTrackDir;
|
||||
|
||||
#endif /* YAPF_NODE_ROAD_HPP */
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef CYapfShipNodeT<CYapfNodeKeyExitDir> CYapfShipNodeExitDir;
|
|||
typedef CYapfShipNodeT<CYapfNodeKeyTrackDir> CYapfShipNodeTrackDir;
|
||||
|
||||
/* Default NodeList types */
|
||||
typedef CNodeList_HashTableT<CYapfShipNodeExitDir , 10, 12> CShipNodeListExitDir;
|
||||
typedef CNodeList_HashTableT<CYapfShipNodeTrackDir, 10, 12> CShipNodeListTrackDir;
|
||||
typedef NodeList<CYapfShipNodeExitDir , 10, 12> CShipNodeListExitDir;
|
||||
typedef NodeList<CYapfShipNodeTrackDir, 10, 12> CShipNodeListTrackDir;
|
||||
|
||||
#endif /* YAPF_NODE_SHIP_HPP */
|
||||
|
|
|
@ -36,9 +36,9 @@ template <class Types>
|
|||
class CYapfReserveTrack
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::TrackFollower TrackFollower;
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
|
||||
protected:
|
||||
/** to access inherited pathfinder */
|
||||
|
@ -203,10 +203,10 @@ template <class Types>
|
|||
class CYapfFollowAnyDepotRailT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
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
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
/** to access inherited path finder */
|
||||
|
@ -294,10 +294,10 @@ template <class Types>
|
|||
class CYapfFollowAnySafeTileRailT : public CYapfReserveTrack<Types>
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
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
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
/** to access inherited path finder */
|
||||
|
@ -376,10 +376,10 @@ template <class Types>
|
|||
class CYapfFollowRailT : public CYapfReserveTrack<Types>
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
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
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
/** to access inherited path finder */
|
||||
|
|
|
@ -21,8 +21,8 @@ class CYapfCostRoadT
|
|||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< pathfinder (derived from THIS class)
|
||||
typedef typename Types::TrackFollower TrackFollower; ///< track follower helper
|
||||
typedef typename Types::NodeList::Titem Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
int max_cost;
|
||||
|
@ -187,10 +187,10 @@ template <class Types>
|
|||
class CYapfDestinationAnyDepotRoadT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
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
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
/** to access inherited path finder */
|
||||
Tpf &Yapf()
|
||||
|
@ -225,10 +225,10 @@ template <class Types>
|
|||
class CYapfDestinationTileRoadT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
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
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
TileIndex dest_tile;
|
||||
|
@ -326,10 +326,10 @@ template <class Types>
|
|||
class CYapfFollowRoadT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class)
|
||||
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
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type
|
||||
typedef typename Node::Key Key; ///< key to hash tables
|
||||
|
||||
protected:
|
||||
/** to access inherited path finder */
|
||||
|
|
|
@ -28,10 +28,10 @@ template <class Types>
|
|||
class CYapfDestinationTileWaterT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class).
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class).
|
||||
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.
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type.
|
||||
typedef typename Node::Key Key; ///< key to hash tables.
|
||||
|
||||
protected:
|
||||
TileIndex dest_tile;
|
||||
|
@ -127,10 +127,10 @@ template <class Types>
|
|||
class CYapfFollowShipT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class).
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class).
|
||||
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.
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type.
|
||||
typedef typename Node::Key Key; ///< key to hash tables.
|
||||
|
||||
protected:
|
||||
/** to access inherited path finder */
|
||||
|
@ -327,10 +327,10 @@ template <class Types>
|
|||
class CYapfCostShipT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class).
|
||||
typedef typename Types::Tpf Tpf; ///< the pathfinder class (derived from THIS class).
|
||||
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.
|
||||
typedef typename Types::NodeList::Item Node; ///< this will be our node type.
|
||||
typedef typename Node::Key Key; ///< key to hash tables.
|
||||
|
||||
/** to access inherited path finder */
|
||||
Tpf &Yapf()
|
||||
|
|
|
@ -89,9 +89,9 @@ template <class Types>
|
|||
class CYapfOriginRegionT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
typedef typename Types::NodeList::Titem Node; ///< This will be our node type.
|
||||
typedef typename Node::Key Key; ///< Key to hash tables.
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
typedef typename Types::NodeList::Item Node; ///< This will be our node type.
|
||||
typedef typename Node::Key Key; ///< Key to hash tables.
|
||||
|
||||
protected:
|
||||
inline Tpf &Yapf() { return *static_cast<Tpf*>(this); }
|
||||
|
@ -126,9 +126,9 @@ template <class Types>
|
|||
class CYapfDestinationRegionT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
typedef typename Types::NodeList::Titem Node; ///< This will be our node type.
|
||||
typedef typename Node::Key Key; ///< Key to hash tables.
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
typedef typename Types::NodeList::Item Node; ///< This will be our node type.
|
||||
typedef typename Node::Key Key; ///< Key to hash tables.
|
||||
|
||||
protected:
|
||||
Key dest;
|
||||
|
@ -166,10 +166,10 @@ template <class Types>
|
|||
class CYapfFollowRegionT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
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.
|
||||
typedef typename Types::NodeList::Item Node; ///< This will be our node type.
|
||||
typedef typename Node::Key Key; ///< Key to hash tables.
|
||||
|
||||
protected:
|
||||
inline Tpf &Yapf() { return *static_cast<Tpf*>(this); }
|
||||
|
@ -238,10 +238,10 @@ template <class Types>
|
|||
class CYapfCostRegionT
|
||||
{
|
||||
public:
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
typedef typename Types::Tpf Tpf; ///< The pathfinder class (derived from THIS class).
|
||||
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.
|
||||
typedef typename Types::NodeList::Item Node; ///< This will be our node type.
|
||||
typedef typename Node::Key Key; ///< Key to hash tables.
|
||||
|
||||
protected:
|
||||
/** To access inherited path finder. */
|
||||
|
@ -293,7 +293,7 @@ struct CYapfRegion_TypesT
|
|||
typedef CYapfCostRegionT<Types> PfCost; ///< Cost provider.
|
||||
};
|
||||
|
||||
typedef CNodeList_HashTableT<CYapfRegionNodeT<CYapfRegionPatchNodeKey>, 12, 12> CRegionNodeListWater;
|
||||
typedef NodeList<CYapfRegionNodeT<CYapfRegionPatchNodeKey>, 12, 12> CRegionNodeListWater;
|
||||
|
||||
struct CYapfRegionWater : CYapfT<CYapfRegion_TypesT<CYapfRegionWater, CRegionNodeListWater>>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue