OpenTTD Source: src/train_cmd.h Source File

OpenTTD Source 15.0-RC2

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
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 "network/network_type.h"
16#include "vehicle_type.h"
17
18 CommandCost CmdBuildRailVehicle(DoCommandFlags flags, TileIndex tile, const Engine *e, Vehicle **ret);
19 CommandCost CmdSellRailWagon(DoCommandFlags flags, Vehicle *t, bool sell_chain, bool backup_order, ClientID user);
20
21 CommandCost CmdMoveRailVehicle(DoCommandFlags flags, VehicleID src_veh, VehicleID dest_veh, bool move_chain);
22 CommandCost CmdForceTrainProceed(DoCommandFlags flags, VehicleID veh_id);
23 CommandCost CmdReverseTrainDirection(DoCommandFlags flags, VehicleID veh_id, bool reverse_single_veh);
24
25DEF_CMD_TRAIT(CMD_MOVE_RAIL_VEHICLE, CmdMoveRailVehicle, CommandFlag::Location, CommandType::VehicleConstruction)
26DEF_CMD_TRAIT(CMD_FORCE_TRAIN_PROCEED, CmdForceTrainProceed, CommandFlag::Location, CommandType::VehicleManagement)
27DEF_CMD_TRAIT(CMD_REVERSE_TRAIN_DIRECTION, CmdReverseTrainDirection, CommandFlag::Location, CommandType::VehicleManagement)
28
29void CcBuildWagon(Commands cmd, const CommandCost &result, VehicleID new_veh_id, uint, uint16_t, CargoArray, TileIndex tile, EngineID, bool, CargoType, ClientID);
30
31#endif /* TRAIN_CMD_H */
CargoType
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
Definition cargo_type.h:21
CommandCost
Common return value for all commands.
Definition command_type.h:24
Engine
Definition engine_base.h:38
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
command_type.h
Types related to commands.
CommandType::VehicleConstruction
@ VehicleConstruction
Construction, modification (incl. refit) and destruction of vehicles.
CommandType::VehicleManagement
@ VehicleManagement
Stopping, starting, sending to depot, turning around, replace orders etc.
CommandFlag::Location
@ Location
the command has implicit location argument.
Commands
Commands
List of commands.
Definition command_type.h:196
CMD_FORCE_TRAIN_PROCEED
@ CMD_FORCE_TRAIN_PROCEED
proceed a train to pass a red signal
Definition command_type.h:247
CMD_REVERSE_TRAIN_DIRECTION
@ CMD_REVERSE_TRAIN_DIRECTION
turn a train around
Definition command_type.h:248
CMD_MOVE_RAIL_VEHICLE
@ CMD_MOVE_RAIL_VEHICLE
move a rail vehicle (in the depot)
Definition command_type.h:246
engine_type.h
Types related to engines.
network_type.h
Types used for networking.
ClientID
ClientID
'Unique' identifier to be given to clients
Definition network_type.h:43
CargoArray
Class for storing amounts of cargo.
Definition cargo_type.h:111
PoolID< uint32_t, struct VehicleIDTag, 0xFF000, 0xFFFFF >
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
Vehicle
Vehicle data structure.
Definition vehicle_base.h:205
CmdForceTrainProceed
CommandCost CmdForceTrainProceed(DoCommandFlags flags, VehicleID veh_id)
Force a train through a red signal.
Definition train_cmd.cpp:2167
CcBuildWagon
void CcBuildWagon(Commands cmd, const CommandCost &result, VehicleID new_veh_id, uint, uint16_t, CargoArray, TileIndex tile, EngineID, bool, CargoType, ClientID)
Callback for building wagons.
Definition train_gui.cpp:29
CmdReverseTrainDirection
CommandCost CmdReverseTrainDirection(DoCommandFlags flags, VehicleID veh_id, bool reverse_single_veh)
Reverse train.
Definition train_cmd.cpp:2073
CmdBuildRailVehicle
CommandCost CmdBuildRailVehicle(DoCommandFlags flags, TileIndex tile, const Engine *e, Vehicle **ret)
Build a railroad vehicle.
Definition train_cmd.cpp:770
CmdMoveRailVehicle
CommandCost CmdMoveRailVehicle(DoCommandFlags flags, VehicleID src_veh, VehicleID dest_veh, bool move_chain)
Move a rail vehicle around inside the depot.
Definition train_cmd.cpp:1218
CmdSellRailWagon
CommandCost CmdSellRailWagon(DoCommandFlags flags, Vehicle *t, bool sell_chain, bool backup_order, ClientID user)
Sell a (single) train wagon/engine.
Definition train_cmd.cpp:1416
vehicle_type.h
Types related to vehicles.