OpenTTD
pathfinder_type.h
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 PATHFINDER_TYPE_H
11 #define PATHFINDER_TYPE_H
12 
13 #include "../tile_type.h"
14 
16 static const int NPF_TILE_LENGTH = 100;
17 
24 static const int NPF_INFINITE_PENALTY = 1000 * NPF_TILE_LENGTH;
25 
26 
28 static const int YAPF_TILE_LENGTH = 100;
29 
31 static const int YAPF_TILE_CORNER_LENGTH = 71;
32 
39 static const int YAPF_INFINITE_PENALTY = 1000 * YAPF_TILE_LENGTH;
40 
42 static const int YAPF_SHIP_PATH_CACHE_LENGTH = 32;
43 
45 static const int YAPF_ROADVEH_PATH_CACHE_SEGMENTS = 8;
46 
50 struct FindDepotData {
52  uint best_length;
53  bool reverse;
54 
61  FindDepotData(TileIndex tile = INVALID_TILE, uint best_length = UINT_MAX, bool reverse = false) :
62  tile(tile), best_length(best_length), reverse(reverse)
63  {
64  }
65 };
66 
67 #endif /* PATHFINDER_TYPE_H */
FindDepotData(TileIndex tile=INVALID_TILE, uint best_length=UINT_MAX, bool reverse=false)
Create an instance of this structure.
bool reverse
True if reversing is necessary for the train to get to this depot.
static const int YAPF_SHIP_PATH_CACHE_LENGTH
Maximum length of ship path cache.
static const int NPF_INFINITE_PENALTY
This penalty is the equivalent of "infinite", which means that paths that get this penalty will be ch...
uint best_length
The distance towards the depot in penalty, or UINT_MAX if not found.
static const int YAPF_TILE_LENGTH
Length (penalty) of one tile with YAPF.
TileIndex tile
The tile of the depot.
static const int YAPF_ROADVEH_PATH_CACHE_SEGMENTS
Maximum segments of road vehicle path cache.
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:78
Helper container to find a depot.
static const int NPF_TILE_LENGTH
Length (penalty) of one tile with NPF.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
Definition: tile_type.h:83
static const int YAPF_TILE_CORNER_LENGTH
Length (penalty) of a corner with YAPF.
static const int YAPF_INFINITE_PENALTY
This penalty is the equivalent of "infinite", which means that paths that get this penalty will be ch...