2006-05-27 18:12:16 +02:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 17:11:33 +02:00
|
|
|
/** @file yapf_node_road.hpp Node tailored for road pathfinding. */
|
2007-02-23 09:37:33 +01:00
|
|
|
|
2006-05-27 18:12:16 +02:00
|
|
|
#ifndef YAPF_NODE_ROAD_HPP
|
|
|
|
#define YAPF_NODE_ROAD_HPP
|
|
|
|
|
|
|
|
/** Yapf Node for road YAPF */
|
|
|
|
template <class Tkey_>
|
|
|
|
struct CYapfRoadNodeT
|
|
|
|
: CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> >
|
|
|
|
{
|
|
|
|
typedef CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> > base;
|
|
|
|
|
|
|
|
TileIndex m_segment_last_tile;
|
|
|
|
Trackdir m_segment_last_td;
|
|
|
|
|
2009-01-10 01:31:47 +01:00
|
|
|
void Set(CYapfRoadNodeT *parent, TileIndex tile, Trackdir td, bool is_choice)
|
2006-05-27 18:12:16 +02:00
|
|
|
{
|
2006-06-07 23:16:43 +02:00
|
|
|
base::Set(parent, tile, td, is_choice);
|
2006-05-27 18:12:16 +02:00
|
|
|
m_segment_last_tile = tile;
|
|
|
|
m_segment_last_td = td;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-03-15 01:32:18 +01:00
|
|
|
/* now define two major node types (that differ by key type) */
|
2006-05-27 18:12:16 +02:00
|
|
|
typedef CYapfRoadNodeT<CYapfNodeKeyExitDir> CYapfRoadNodeExitDir;
|
|
|
|
typedef CYapfRoadNodeT<CYapfNodeKeyTrackDir> CYapfRoadNodeTrackDir;
|
|
|
|
|
2009-03-15 01:32:18 +01:00
|
|
|
/* Default NodeList types */
|
2006-05-27 18:12:16 +02:00
|
|
|
typedef CNodeList_HashTableT<CYapfRoadNodeExitDir , 8, 12> CRoadNodeListExitDir;
|
|
|
|
typedef CNodeList_HashTableT<CYapfRoadNodeTrackDir, 10, 14> CRoadNodeListTrackDir;
|
|
|
|
|
|
|
|
#endif /* YAPF_NODE_ROAD_HPP */
|