diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-11-17 00:40:06 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | e08b3abe7ff65c193781a74c170f45b2f1dcf0a5 (patch) | |
tree | 2b9c5d0a1012e63498c39cc557e826edff47696f /src/group_cmd.h | |
parent | 46bd2f1cedde365218a3f1a52116fe169587af89 (diff) | |
download | openttd-e08b3abe7ff65c193781a74c170f45b2f1dcf0a5.tar.xz |
Codechange: Un-bitstuff group and autoreplace commands.
Diffstat (limited to 'src/group_cmd.h')
-rw-r--r-- | src/group_cmd.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/group_cmd.h b/src/group_cmd.h index 7f3496cc9..70610de75 100644 --- a/src/group_cmd.h +++ b/src/group_cmd.h @@ -11,15 +11,26 @@ #define GROUP_CMD_H #include "command_type.h" +#include "group_type.h" +#include "vehicle_type.h" -CommandProc CmdCreateGroup; -CommandProc CmdAlterGroup; -CommandProc CmdDeleteGroup; -CommandProc CmdAddVehicleGroup; -CommandProc CmdAddSharedVehicleGroup; -CommandProc CmdRemoveAllVehiclesGroup; -CommandProc CmdSetGroupFlag; -CommandProc CmdSetGroupLivery; +enum Colours : byte; +enum GroupFlags : uint8; + +/** Action for \c CmdAlterGroup. */ +enum class AlterGroupMode : byte { + Rename, ///< Change group name. + SetParent, ///< Change group parent. +}; + +CommandCost CmdCreateGroup(DoCommandFlag flags, VehicleType vt, GroupID parent_group); +CommandCost CmdAlterGroup(DoCommandFlag flags, AlterGroupMode mode, GroupID group_id, GroupID parent_id, const std::string &text); +CommandCost CmdDeleteGroup(DoCommandFlag flags, GroupID group_id); +CommandCost CmdAddVehicleGroup(DoCommandFlag flags, GroupID group_id, VehicleID veh_id, bool add_shared); +CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, GroupID id_g, VehicleType type); +CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, GroupID group_id); +CommandCost CmdSetGroupFlag(DoCommandFlag flags, GroupID group_id, GroupFlags flag, bool value, bool recursive); +CommandCost CmdSetGroupLivery(DoCommandFlag flags, GroupID group_id, bool primary, Colours colour); DEF_CMD_TRAIT(CMD_CREATE_GROUP, CmdCreateGroup, 0, CMDT_ROUTE_MANAGEMENT) DEF_CMD_TRAIT(CMD_DELETE_GROUP, CmdDeleteGroup, 0, CMDT_ROUTE_MANAGEMENT) |