OpenTTD

pathfinder_type.h
Go to the documentation of this file.
1 /* $Id: pathfinder_type.h 24900 2013-01-08 22:46:42Z planetmaker $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
9
12 #ifndef PATHFINDER_TYPE_H
13 #define PATHFINDER_TYPE_H
14
15 #include "../tile_type.h"
16
18 static const int NPF_TILE_LENGTH = 100;
19
26 static const int NPF_INFINITE_PENALTY = 1000 * NPF_TILE_LENGTH;
27
28
30 static const int YAPF_TILE_LENGTH = 100;
31
33 static const int YAPF_TILE_CORNER_LENGTH = 71;
34
41 static const int YAPF_INFINITE_PENALTY = 1000 * YAPF_TILE_LENGTH;
42
46 struct FindDepotData {
47 TileIndex tile;
48 uint best_length;
49 bool reverse;
50
57 FindDepotData(TileIndex tile = INVALID_TILE, uint best_length = UINT_MAX, bool reverse = false) :
58 tile(tile), best_length(best_length), reverse(reverse)
59 {
60 }
61 };
62
63 #endif /* PATHFINDER_TYPE_H */
FindDepotData::FindDepotData
FindDepotData(TileIndex tile=INVALID_TILE, uint best_length=UINT_MAX, bool reverse=false)
Create an instance of this structure.
Definition: pathfinder_type.h:57
FindDepotData::reverse
bool reverse
True if reversing is necessary for the train to get to this depot.
Definition: pathfinder_type.h:49
NPF_INFINITE_PENALTY
static const int NPF_INFINITE_PENALTY
This penalty is the equivalent of "infinite", which means that paths that get this penalty will be ch...
Definition: pathfinder_type.h:26
FindDepotData::best_length
uint best_length
The distance towards the depot in penalty, or UINT_MAX if not found.
Definition: pathfinder_type.h:48
YAPF_TILE_LENGTH
static const int YAPF_TILE_LENGTH
Length (penalty) of one tile with YAPF.
Definition: pathfinder_type.h:30
FindDepotData::tile
TileIndex tile
The tile of the depot.
Definition: pathfinder_type.h:47
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
FindDepotData
Helper container to find a depot.
Definition: pathfinder_type.h:46
NPF_TILE_LENGTH
static const int NPF_TILE_LENGTH
Length (penalty) of one tile with NPF.
Definition: pathfinder_type.h:18
INVALID_TILE
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
Definition: tile_type.h:85
YAPF_TILE_CORNER_LENGTH
static const int YAPF_TILE_CORNER_LENGTH
Length (penalty) of a corner with YAPF.
Definition: pathfinder_type.h:33
YAPF_INFINITE_PENALTY
static const int YAPF_INFINITE_PENALTY
This penalty is the equivalent of "infinite", which means that paths that get this penalty will be ch...
Definition: pathfinder_type.h:41