OpenTTD Source: src/pathfinder/yapf/yapf_node_road.hpp Source File

OpenTTD Source 14.0-beta1

yapf_node_road.hpp
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
7
10 #ifndef YAPF_NODE_ROAD_HPP
11 #define YAPF_NODE_ROAD_HPP
12
14 template <class Tkey_>
15 struct CYapfRoadNodeT : CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> > {
16 typedef CYapfNodeT<Tkey_, CYapfRoadNodeT<Tkey_> > base;
17
18 TileIndex m_segment_last_tile;
19 Trackdir m_segment_last_td;
20
21 void Set(CYapfRoadNodeT *parent, TileIndex tile, Trackdir td, bool is_choice)
22 {
23 base::Set(parent, tile, td, is_choice);
24 m_segment_last_tile = tile;
25 m_segment_last_td = td;
26 }
27 };
28
29 /* now define two major node types (that differ by key type) */
30 typedef CYapfRoadNodeT<CYapfNodeKeyExitDir> CYapfRoadNodeExitDir;
31 typedef CYapfRoadNodeT<CYapfNodeKeyTrackDir> CYapfRoadNodeTrackDir;
32
33 /* Default NodeList types */
34 typedef CNodeList_HashTableT<CYapfRoadNodeExitDir , 8, 10> CRoadNodeListExitDir;
35 typedef CNodeList_HashTableT<CYapfRoadNodeTrackDir, 8, 10> CRoadNodeListTrackDir;
36
37 #endif /* YAPF_NODE_ROAD_HPP */
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
CYapfRoadNodeT
Yapf Node for road YAPF.
Definition: yapf_node_road.hpp:15
CNodeList_HashTableT
Hash table based node list multi-container class.
Definition: nodelist.hpp:23
CYapfNodeT
Yapf Node base.
Definition: yapf_node.hpp:59
Trackdir
Trackdir
Enumeration for tracks and directions.
Definition: track_type.h:67