Rearrange storage of reserved tracks for railway tiles
[openttd/fttd.git] / src / signal_func.h
blobc94ecccfebd999d97f83425c72ecd41e5f227db2
1 /* $Id$ */
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 */
10 /** @file signal_func.h Functions related to signals. */
12 #ifndef SIGNAL_FUNC_H
13 #define SIGNAL_FUNC_H
15 #include "map/coord.h"
16 #include "track_type.h"
17 #include "direction_type.h"
18 #include "company_type.h"
19 #include "pathfinder/pos.h"
21 /** State of the signal segment */
22 enum SigSegState {
23 SIGSEG_NONE, ///< There was no segment (not usually a returned value)
24 SIGSEG_FREE, ///< Free and has no pre-signal exits or at least one green exit
25 SIGSEG_FULL, ///< Occupied by a train
26 SIGSEG_PBS, ///< Segment is a PBS segment
29 bool IsSignalBufferEmpty();
31 void AddTrackToSignalBuffer(TileIndex tile, Track track, Owner owner);
32 void AddSideToSignalBuffer(TileIndex tile, DiagDirection side, Owner owner);
33 void AddDepotToSignalBuffer(TileIndex tile, Owner owner);
34 void AddBridgeToSignalBuffer(TileIndex tile, Owner owner);
35 void AddTunnelToSignalBuffer(TileIndex tile, Owner owner);
36 void AddPosToSignalBuffer(const RailPathPos &pos, Owner owner);
37 SigSegState UpdateSignalsInBuffer();
39 #endif /* SIGNAL_FUNC_H */