1 /*
2  * Copyright (C) 2002-2020 by the Widelands Development Team
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  *
18  */
19 
20 #ifndef WL_LOGIC_QUEUE_CMD_IDS_H
21 #define WL_LOGIC_QUEUE_CMD_IDS_H
22 
23 #include <cstdint>
24 
25 /*
26  * This file contains the ids for the different
27  * cmd_queue cmds. They are needed to save those
28  * files to disk and (even more important) to load
29  * them again.
30  *
31  * Some of this Commands (the player commands) have another
32  * index, but this one is completley independent and only for
33  * writing to files
34  */
35 
36 namespace Widelands {
37 
38 // The command types are used by the QueueCmdFactory, for network serialization
39 // and for savegame compatibility.
40 // DO NOT change the order
41 // TODO(GunChleoc): Whenever we break savegame compatibility, clean this up and change data type to
42 // uint16_t.
43 enum class QueueCommandTypes : uint8_t {
44 
45 	/* ID zero is reserved and must never be used */
46 	kNone = 0,
47 
48 	/* PLAYER COMMANDS BELOW */
49 	kBuild,
50 	kBuildFlag,
51 	kBuildRoad,
52 	kFlagAction,
53 	kStartStopBuilding,
54 	kEnhanceBuilding,
55 	kBulldoze,
56 
57 	kChangeTrainingOptions,
58 	kDropSoldier,
59 	kChangeSoldierCapacity,
60 	kEnemyFlagAction,
61 
62 	kSetWarePriority,
63 	kSetWareTargetQuantity,
64 	kResetWareTargetQuantity,
65 	kSetWorkerTargetQuantity,
66 	kResetWorkerTargetQuantity,  // 16
67 
68 	// 17 was a command related to old events. removed
69 
70 	kSetInputMaxFill = 18,
71 
72 	kMessageSetStatusRead = 21,
73 	kMessageSetStatusArchived,
74 
75 	kSetStockPolicy,
76 	kDismantleBuilding,
77 
78 	kEvictWorker,
79 
80 	kMilitarysiteSetSoldierPreference,
81 	kProposeTrade,
82 	kBuildWaterway,  // 28
83 
84 	kShipSink = 121,
85 	kShipCancelExpedition,
86 	kStartOrCancelExpedition,
87 	kShipConstructPort,
88 	kShipScoutDirection,
89 	kShipExploreIsland,
90 
91 	// The commands below are never serialized, but we still keep the IDs stable for savegame
92 	// compatibility.
93 
94 	kDestroyMapObject,
95 	kAct,  // 128
96 	// 129 was a command related to old events. removed
97 	kIncorporate = 130,
98 	kLuaScript,
99 	kLuaCoroutine,
100 	kCalculateStatistics,
101 	kExpeditionConfig,  // 134
102 	kCallEconomyBalance = 200,
103 
104 	kDeleteMessage,  // 201
105 
106 	kNetCheckSync = 250,
107 	kReplaySyncWrite,
108 	kReplaySyncRead,
109 	kReplayEnd  // 253
110 };
111 
112 }  // namespace Widelands
113 
114 #endif  // end of include guard: WL_LOGIC_QUEUE_CMD_IDS_H
115