OpenTTD Source  20240917-master-g9ab0a47812
rail_cmd.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 RAIL_CMD_H
11 #define RAIL_CMD_H
12 
13 #include "command_type.h"
14 #include "track_type.h"
15 #include "rail_type.h"
16 #include "signal_type.h"
17 
18 CommandCost CmdBuildRailroadTrack(DoCommandFlag flags, TileIndex end_tile, TileIndex start_tile, RailType railtype, Track track, bool auto_remove_signals, bool fail_on_obstacle);
19 CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex end_tile, TileIndex start_tile, Track track);
20 CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType railtype, Track track, bool auto_remove_signals);
23 CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8_t num_dir_cycle, uint8_t signals_copy);
25 CommandCost CmdConvertRail(DoCommandFlag flags, TileIndex tile, TileIndex area_start, RailType totype, bool diagonal);
26 CommandCost CmdBuildSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool autofill, bool minimise_gaps, uint8_t signal_density);
27 CommandCost CmdRemoveSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, bool autofill);
28 
39 
40 CommandCallback CcPlaySound_CONSTRUCTION_RAIL;
41 CommandCallback CcStation;
43 void CcRailDepot(Commands cmd, const CommandCost &result, TileIndex tile, RailType rt, DiagDirection dir);
44 
45 #endif /* RAIL_CMD_H */
CcBuildRailTunnel
void CcBuildRailTunnel(Commands, const CommandCost &result, TileIndex tile)
Command callback for building a tunnel.
Definition: rail_gui.cpp:303
CMD_BUILD_SIGNAL_TRACK
@ CMD_BUILD_SIGNAL_TRACK
add signals along a track (by dragging)
Definition: command_type.h:326
CMD_BUILD_SINGLE_SIGNAL
@ CMD_BUILD_SINGLE_SIGNAL
build a signal
Definition: command_type.h:196
CmdRemoveSignalTrack
CommandCost CmdRemoveSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, bool autofill)
Remove signals on a stretch of track.
Definition: rail_cmd.cpp:1527
CMD_BUILD_SINGLE_RAIL
@ CMD_BUILD_SINGLE_RAIL
build a single rail track
Definition: command_type.h:190
CMD_REMOVE_SINGLE_RAIL
@ CMD_REMOVE_SINGLE_RAIL
remove a single rail track
Definition: command_type.h:191
RailType
RailType
Enumeration for all possible railtypes.
Definition: rail_type.h:27
CmdRemoveSingleRail
CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, Track track)
Remove a single piece of track.
Definition: rail_cmd.cpp:615
CmdBuildRailroadTrack
CommandCost CmdBuildRailroadTrack(DoCommandFlag flags, TileIndex end_tile, TileIndex start_tile, RailType railtype, Track track, bool auto_remove_signals, bool fail_on_obstacle)
Build rail on a stretch of track.
Definition: rail_cmd.cpp:932
DiagDirection
DiagDirection
Enumeration for diagonal directions.
Definition: direction_type.h:73
CmdRemoveRailroadTrack
CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex end_tile, TileIndex start_tile, Track track)
Build rail on a stretch of track.
Definition: rail_cmd.cpp:947
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
CommandCallback
void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile)
Define a callback function for the client, after the command is finished.
Definition: command_type.h:484
CMD_CONVERT_RAIL
@ CMD_CONVERT_RAIL
convert a rail type
Definition: command_type.h:204
CMD_REMOVE_RAILROAD_TRACK
@ CMD_REMOVE_RAILROAD_TRACK
remove a rail track
Definition: command_type.h:189
CmdConvertRail
CommandCost CmdConvertRail(DoCommandFlag flags, TileIndex tile, TileIndex area_start, RailType totype, bool diagonal)
Convert one rail type to the other.
Definition: rail_cmd.cpp:1553
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:374
SignalVariant
SignalVariant
Variant of the signal, i.e.
Definition: signal_type.h:16
CmdBuildSignalTrack
CommandCost CmdBuildSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool autofill, bool minimise_gaps, uint8_t signal_density)
Build signals on a stretch of track.
Definition: rail_cmd.cpp:1449
CommandCost
Common return value for all commands.
Definition: command_type.h:23
CMD_AUTO
@ CMD_AUTO
set the DC_AUTO flag on this command
Definition: command_type.h:400
CmdRemoveSingleSignal
CommandCost CmdRemoveSingleSignal(DoCommandFlag flags, TileIndex tile, Track track)
Remove signals.
Definition: rail_cmd.cpp:1461
CmdBuildSingleSignal
CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8_t num_dir_cycle, uint8_t signals_copy)
Build signals, alternate between double/single, signal/semaphore, pre/exit/combo-signals,...
Definition: rail_cmd.cpp:1052
CmdBuildSingleRail
CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType railtype, Track track, bool auto_remove_signals)
Build a single piece of rail.
Definition: rail_cmd.cpp:426
CMD_REMOVE_SINGLE_SIGNAL
@ CMD_REMOVE_SINGLE_SIGNAL
remove a signal
Definition: command_type.h:197
command_type.h
signal_type.h
Track
Track
These are used to specify a single track.
Definition: track_type.h:19
CMD_NO_WATER
@ CMD_NO_WATER
set the DC_NO_WATER flag on this command
Definition: command_type.h:403
CmdBuildTrainDepot
CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType railtype, DiagDirection dir)
Build a train depot.
Definition: rail_cmd.cpp:963
rail_type.h
CMD_BUILD_RAILROAD_TRACK
@ CMD_BUILD_RAILROAD_TRACK
build a rail track
Definition: command_type.h:188
Commands
Commands
List of commands.
Definition: command_type.h:187
SignalType
SignalType
Type of signal, i.e.
Definition: signal_type.h:23
CMD_BUILD_TRAIN_DEPOT
@ CMD_BUILD_TRAIN_DEPOT
build a train depot
Definition: command_type.h:195
CMDT_LANDSCAPE_CONSTRUCTION
@ CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
Definition: command_type.h:414
track_type.h
CMD_REMOVE_SIGNAL_TRACK
@ CMD_REMOVE_SIGNAL_TRACK
remove signals along a track (by dragging)
Definition: command_type.h:327