author | truelight |
Thu, 24 Mar 2005 14:43:40 +0000 | |
changeset 1540 | 6eef12dab5bf |
parent 1287 | adb8820d4600 |
child 1621 | 890ab08b9855 |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef COMMAND_H |
2 |
#define COMMAND_H |
|
3 |
||
4 |
enum { |
|
5 |
CMD_BUILD_RAILROAD_TRACK = 0, |
|
6 |
CMD_REMOVE_RAILROAD_TRACK = 1, |
|
7 |
CMD_BUILD_SINGLE_RAIL = 2, |
|
8 |
CMD_REMOVE_SINGLE_RAIL = 3, |
|
9 |
CMD_LANDSCAPE_CLEAR = 4, |
|
10 |
CMD_BUILD_BRIDGE = 5, |
|
11 |
CMD_BUILD_RAILROAD_STATION = 6, |
|
12 |
CMD_BUILD_TRAIN_DEPOT = 7, |
|
13 |
CMD_BUILD_SIGNALS = 8, |
|
14 |
CMD_REMOVE_SIGNALS = 9, |
|
15 |
CMD_TERRAFORM_LAND = 10, |
|
16 |
CMD_PURCHASE_LAND_AREA = 11, |
|
17 |
CMD_SELL_LAND_AREA = 12, |
|
18 |
CMD_BUILD_TUNNEL = 13, |
|
19 |
||
20 |
CMD_REMOVE_FROM_RAILROAD_STATION = 14, |
|
21 |
CMD_CONVERT_RAIL = 15, |
|
22 |
||
395
788a9bba0889
(svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky).
darkvater
parents:
213
diff
changeset
|
23 |
CMD_BUILD_TRAIN_WAYPOINT = 16, |
788a9bba0889
(svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky).
darkvater
parents:
213
diff
changeset
|
24 |
CMD_RENAME_WAYPOINT = 17, |
788a9bba0889
(svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky).
darkvater
parents:
213
diff
changeset
|
25 |
CMD_REMOVE_TRAIN_WAYPOINT = 18, |
0 | 26 |
|
1217
59c024cfaf54
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
27 |
CMD_BUILD_ROAD_STOP = 21, |
0 | 28 |
CMD_BUILD_LONG_ROAD = 23, |
29 |
CMD_REMOVE_LONG_ROAD = 24, |
|
30 |
CMD_BUILD_ROAD = 25, |
|
31 |
CMD_REMOVE_ROAD = 26, |
|
32 |
CMD_BUILD_ROAD_DEPOT = 27, |
|
33 |
||
34 |
CMD_BUILD_AIRPORT = 29, |
|
35 |
||
36 |
CMD_BUILD_DOCK = 30, |
|
37 |
||
38 |
CMD_BUILD_SHIP_DEPOT = 31, |
|
39 |
CMD_BUILD_BUOY = 32, |
|
40 |
||
41 |
CMD_PLANT_TREE = 33, |
|
42 |
||
43 |
CMD_BUILD_RAIL_VEHICLE = 34, |
|
44 |
CMD_MOVE_RAIL_VEHICLE = 35, |
|
45 |
||
46 |
CMD_START_STOP_TRAIN = 36, |
|
47 |
||
48 |
CMD_SELL_RAIL_WAGON = 38, |
|
49 |
||
50 |
CMD_TRAIN_GOTO_DEPOT = 39, |
|
51 |
CMD_FORCE_TRAIN_PROCEED = 40, |
|
52 |
CMD_REVERSE_TRAIN_DIRECTION = 41, |
|
53 |
||
54 |
CMD_MODIFY_ORDER = 42, |
|
55 |
CMD_SKIP_ORDER = 43, |
|
56 |
CMD_DELETE_ORDER = 44, |
|
57 |
CMD_INSERT_ORDER = 45, |
|
58 |
||
59 |
CMD_CHANGE_TRAIN_SERVICE_INT = 46, |
|
60 |
||
61 |
CMD_BUILD_INDUSTRY = 47, |
|
62 |
||
63 |
CMD_BUILD_COMPANY_HQ = 48, |
|
64 |
CMD_SET_PLAYER_FACE = 49, |
|
65 |
CMD_SET_PLAYER_COLOR = 50, |
|
66 |
||
67 |
CMD_INCREASE_LOAN = 51, |
|
68 |
CMD_DECREASE_LOAN = 52, |
|
69 |
||
70 |
CMD_WANT_ENGINE_PREVIEW = 53, |
|
71 |
||
72 |
CMD_NAME_VEHICLE = 54, |
|
73 |
CMD_RENAME_ENGINE = 55, |
|
74 |
CMD_CHANGE_COMPANY_NAME = 56, |
|
75 |
CMD_CHANGE_PRESIDENT_NAME = 57, |
|
76 |
CMD_RENAME_STATION = 58, |
|
77 |
||
78 |
CMD_SELL_AIRCRAFT = 59, |
|
79 |
CMD_START_STOP_AIRCRAFT = 60, |
|
80 |
CMD_BUILD_AIRCRAFT = 61, |
|
81 |
CMD_SEND_AIRCRAFT_TO_HANGAR = 62, |
|
82 |
CMD_CHANGE_AIRCRAFT_SERVICE_INT = 63, |
|
83 |
CMD_REFIT_AIRCRAFT = 64, |
|
84 |
||
85 |
CMD_PLACE_SIGN = 65, |
|
86 |
CMD_RENAME_SIGN = 66, |
|
87 |
||
88 |
CMD_BUILD_ROAD_VEH = 67, |
|
89 |
CMD_START_STOP_ROADVEH = 68, |
|
90 |
CMD_SELL_ROAD_VEH = 69, |
|
91 |
CMD_SEND_ROADVEH_TO_DEPOT = 70, |
|
92 |
CMD_TURN_ROADVEH = 71, |
|
93 |
CMD_CHANGE_ROADVEH_SERVICE_INT = 72, |
|
94 |
||
95 |
CMD_PAUSE = 73, |
|
96 |
||
97 |
CMD_BUY_SHARE_IN_COMPANY = 74, |
|
98 |
CMD_SELL_SHARE_IN_COMPANY = 75, |
|
99 |
CMD_BUY_COMPANY = 76, |
|
100 |
||
101 |
CMD_BUILD_TOWN = 77, |
|
102 |
||
103 |
CMD_RENAME_TOWN = 80, |
|
104 |
CMD_DO_TOWN_ACTION = 81, |
|
105 |
||
106 |
CMD_SET_ROAD_DRIVE_SIDE = 82, |
|
107 |
CMD_SET_TOWN_NAME_TYPE = 83, |
|
108 |
||
109 |
||
110 |
CMD_CHANGE_DIFFICULTY_LEVEL = 85, |
|
111 |
||
112 |
CMD_START_STOP_SHIP = 86, |
|
113 |
CMD_SELL_SHIP = 87, |
|
114 |
CMD_BUILD_SHIP = 88, |
|
115 |
CMD_SEND_SHIP_TO_DEPOT = 89, |
|
116 |
CMD_CHANGE_SHIP_SERVICE_INT = 90, |
|
117 |
CMD_REFIT_SHIP = 91, |
|
118 |
||
119 |
CMD_START_NEW_GAME = 92, |
|
120 |
CMD_LOAD_GAME = 93, |
|
121 |
CMD_CREATE_SCENARIO = 94, |
|
122 |
CMD_SET_SINGLE_PLAYER = 95, |
|
123 |
||
124 |
CMD_SET_NEW_LANDSCAPE_TYPE = 97, |
|
125 |
||
126 |
CMD_GEN_RANDOM_NEW_GAME = 98, |
|
127 |
||
128 |
CMD_CLONE_ORDER = 99, |
|
129 |
CMD_CLEAR_AREA = 100, |
|
130 |
||
131 |
CMD_RESUME = 101, |
|
132 |
||
133 |
CMD_MONEY_CHEAT = 102, |
|
134 |
CMD_BUILD_CANAL = 103, |
|
135 |
||
136 |
CMD_PLAYER_CTRL = 104, // used in multiplayer to create a new player etc. |
|
137 |
CMD_LEVEL_LAND = 105, // level land |
|
138 |
||
139 |
CMD_REFIT_RAIL_VEHICLE = 106, |
|
140 |
CMD_RESTORE_ORDER_INDEX = 107, |
|
141 |
CMD_BUILD_LOCK = 108, |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
142 |
|
0 | 143 |
CMD_START_SCENARIO = 109, |
1227
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
144 |
CMD_BUILD_SIGNAL_TRACK = 110, |
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
145 |
CMD_REMOVE_SIGNAL_TRACK = 111, |
0 | 146 |
|
1227
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
147 |
CMD_DESTROY_COMPANY_HQ = 112, |
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
148 |
CMD_GIVE_MONEY = 113, |
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
149 |
CMD_CHANGE_PATCH_SETTING = 114, |
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
150 |
|
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
151 |
CMD_REPLACE_VEHICLE = 115, |
0 | 152 |
}; |
153 |
||
154 |
enum { |
|
155 |
DC_EXEC = 1, |
|
156 |
DC_AUTO = 2, // don't allow building on structures |
|
157 |
DC_QUERY_COST = 4, // query cost only, don't build. |
|
158 |
DC_NO_WATER = 8, // don't allow building on water |
|
159 |
DC_NO_RAIL_OVERLAP = 0x10, // don't allow overlap of rails (used in buildrail) |
|
160 |
DC_AI_BUILDING = 0x20, // special building rules for AI |
|
161 |
DC_NO_TOWN_RATING = 0x40, // town rating does not disallow you from building |
|
162 |
DC_FORCETEST = 0x80, // force test too. |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
163 |
|
0 | 164 |
CMD_ERROR = ((int32)0x80000000), |
165 |
}; |
|
166 |
||
167 |
#define CMD_MSG(x) ((x)<<16) |
|
168 |
||
169 |
enum { |
|
170 |
CMD_AUTO = 0x200, |
|
171 |
CMD_NO_WATER = 0x400, |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
395
diff
changeset
|
172 |
CMD_NETWORK_COMMAND = 0x800, // execute the command without sending it on the network |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
395
diff
changeset
|
173 |
CMD_NO_TEST_IF_IN_NETWORK = 0x1000, // When enabled, the command will bypass the no-DC_EXEC round if in network |
842 | 174 |
CMD_SHOW_NO_ERROR = 0x2000, |
0 | 175 |
}; |
176 |
||
177 |
//#define return_cmd_error(errcode) do { _error_message=(errcode); return CMD_ERROR; } while(0) |
|
178 |
#define return_cmd_error(errcode) do { return CMD_ERROR | (errcode); } while (0) |
|
179 |
||
180 |
/* command.c */ |
|
181 |
int32 DoCommand(int x, int y, uint32 p1, uint32 p2, uint32 flags, uint procc); |
|
182 |
int32 DoCommandByTile(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc); |
|
183 |
||
959
e6a3bbda610f
(svn r1451) Fix some of the signed/unsigned comparison warnings
tron
parents:
903
diff
changeset
|
184 |
bool IsValidCommand(uint cmd); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
959
diff
changeset
|
185 |
int32 GetAvailableMoneyForCommand(void); |
0 | 186 |
|
187 |
#endif /* COMMAND_H */ |