OpenTTD Source: src/train_cmd.h Source File

OpenTTD Source 14.0-beta1

train_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 TRAIN_CMD_H
11 #define TRAIN_CMD_H
12
13 #include "command_type.h"
14 #include "engine_type.h"
15 #include "vehicle_type.h"
16
17 CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **ret);
18 CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, bool sell_chain, bool backup_order, ClientID user);
19
20 CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID dest_veh, bool move_chain);
21 CommandCost CmdForceTrainProceed(DoCommandFlag flags, VehicleID veh_id);
22 CommandCost CmdReverseTrainDirection(DoCommandFlag flags, VehicleID veh_id, bool reverse_single_veh);
23
24 DEF_CMD_TRAIT(CMD_MOVE_RAIL_VEHICLE, CmdMoveRailVehicle, CMD_LOCATION, CMDT_VEHICLE_CONSTRUCTION)
25 DEF_CMD_TRAIT(CMD_FORCE_TRAIN_PROCEED, CmdForceTrainProceed, CMD_LOCATION, CMDT_VEHICLE_MANAGEMENT)
26 DEF_CMD_TRAIT(CMD_REVERSE_TRAIN_DIRECTION, CmdReverseTrainDirection, CMD_LOCATION, CMDT_VEHICLE_MANAGEMENT)
27
28 void CcBuildWagon(Commands cmd, const CommandCost &result, VehicleID new_veh_id, uint, uint16_t, CargoArray, TileIndex tile, EngineID, bool, CargoID, ClientID);
29
30 #endif /* TRAIN_CMD_H */
CmdSellRailWagon
CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, bool sell_chain, bool backup_order, ClientID user)
Sell a (single) train wagon/engine.
Definition: train_cmd.cpp:1388
CMDT_VEHICLE_CONSTRUCTION
@ CMDT_VEHICLE_CONSTRUCTION
Construction, modification (incl. refit) and destruction of vehicles.
Definition: command_type.h:410
CMD_LOCATION
@ CMD_LOCATION
the command has implicit location argument.
Definition: command_type.h:403
CargoArray
Class for storing amounts of cargo.
Definition: cargo_type.h:97
CmdForceTrainProceed
CommandCost CmdForceTrainProceed(DoCommandFlag flags, VehicleID veh_id)
Force a train through a red signal.
Definition: train_cmd.cpp:2129
CMD_FORCE_TRAIN_PROCEED
@ CMD_FORCE_TRAIN_PROCEED
proceed a train to pass a red signal
Definition: command_type.h:234
CmdBuildRailVehicle
CommandCost CmdBuildRailVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **ret)
Build a railroad vehicle.
Definition: train_cmd.cpp:749
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
Engine
Definition: engine_base.h:37
Vehicle
Vehicle data structure.
Definition: vehicle_base.h:240
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:369
CcBuildWagon
void CcBuildWagon(Commands cmd, const CommandCost &result, VehicleID new_veh_id, uint, uint16_t, CargoArray, TileIndex tile, EngineID, bool, CargoID, ClientID)
Callback for building wagons.
Definition: train_gui.cpp:29
CommandCost
Common return value for all commands.
Definition: command_type.h:23
CmdReverseTrainDirection
CommandCost CmdReverseTrainDirection(DoCommandFlag flags, VehicleID veh_id, bool reverse_single_veh)
Reverse train.
Definition: train_cmd.cpp:2056
VehicleID
uint32_t VehicleID
The type all our vehicle IDs have.
Definition: vehicle_type.h:16
CMD_MOVE_RAIL_VEHICLE
@ CMD_MOVE_RAIL_VEHICLE
move a rail vehicle (in the depot)
Definition: command_type.h:233
command_type.h
vehicle_type.h
CMDT_VEHICLE_MANAGEMENT
@ CMDT_VEHICLE_MANAGEMENT
Stopping, starting, sending to depot, turning around, replace orders etc.
Definition: command_type.h:412
engine_type.h
ClientID
ClientID
'Unique' identifier to be given to clients
Definition: network_type.h:49
CMD_REVERSE_TRAIN_DIRECTION
@ CMD_REVERSE_TRAIN_DIRECTION
turn a train around
Definition: command_type.h:235
CmdMoveRailVehicle
CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID dest_veh, bool move_chain)
Move a rail vehicle around inside the depot.
Definition: train_cmd.cpp:1191
CargoID
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:20
EngineID
uint16_t EngineID
Unique identification number of an engine.
Definition: engine_type.h:21
Commands
Commands
List of commands.
Definition: command_type.h:187