Mercurial > hg > openttd
annotate src/tile_cmd.h @ 11799:3a6a820d27e2 draft
(svn r16189) -Doc: Additions and improvement of (mainly) nested widgets/widget-parts doxygen docs.
author | alberth <alberth@openttd.org> |
---|---|
date | Thu, 30 Apr 2009 17:35:38 +0000 |
parents | df23c4e04638 |
children | 69298536ac76 |
rev | line source |
---|---|
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
2 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
3 /** @file tile_cmd.h Generic 'commands' that can be performed on all tiles. */ |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
4 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
5 #ifndef TILE_CMD_H |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
6 #define TILE_CMD_H |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
7 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
8 #include "slope_type.h" |
8138
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
9 #include "tile_type.h" |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
10 #include "command_type.h" |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
11 #include "vehicle_type.h" |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
12 #include "cargo_type.h" |
8138
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
13 #include "strings_type.h" |
8140
fb8a05d579da
(svn r11702) -Codechange: move all date related stuff to date*.
rubidium <rubidium@openttd.org>
parents:
8138
diff
changeset
|
14 #include "date_type.h" |
10208
39cf8eebfda5
(svn r14422) -Codechange: also reflect the changes of r14421 in the filenames.
rubidium <rubidium@openttd.org>
parents:
10207
diff
changeset
|
15 #include "company_type.h" |
8596
ae0c04ca28d2
(svn r12177) -Codechange: use 'side' parameter in GetTileTrackStatus so there can be less checks in pathfinders for depots/stations/tunnels/bridges
smatz <smatz@openttd.org>
parents:
8373
diff
changeset
|
16 #include "direction_type.h" |
8616
9e46ac001a8c
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
frosch <frosch@openttd.org>
parents:
8596
diff
changeset
|
17 #include "track_type.h" |
9126
8c450e1754e2
(svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers.
rubidium <rubidium@openttd.org>
parents:
9125
diff
changeset
|
18 #include "transport_type.h" |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
19 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
20 /** The returned bits of VehicleEnterTile. */ |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
21 enum VehicleEnterTileStatus { |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
22 VETS_ENTERED_STATION = 1, ///< The vehicle entered a station |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
23 VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel) |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
24 VETS_CANNOT_ENTER = 3, ///< The vehicle cannot enter the tile |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
25 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
26 /** |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
27 * Shift the VehicleEnterTileStatus this many bits |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
28 * to the right to get the station ID when |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
29 * VETS_ENTERED_STATION is set |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
30 */ |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
31 VETS_STATION_ID_OFFSET = 8, |
8373
a6209668c216
(svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents:
8254
diff
changeset
|
32 VETS_STATION_MASK = 0xFFFF << VETS_STATION_ID_OFFSET, |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
33 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
34 /** Bit sets of the above specified bits */ |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
35 VETSB_CONTINUE = 0, ///< The vehicle can continue normally |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
36 VETSB_ENTERED_STATION = 1 << VETS_ENTERED_STATION, ///< The vehicle entered a station |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
37 VETSB_ENTERED_WORMHOLE = 1 << VETS_ENTERED_WORMHOLE, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel) |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
38 VETSB_CANNOT_ENTER = 1 << VETS_CANNOT_ENTER, ///< The vehicle cannot enter the tile |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
39 }; |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
40 DECLARE_ENUM_AS_BIT_SET(VehicleEnterTileStatus); |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
41 |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
42 /** Tile information, used while rendering the tile */ |
8138
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
43 struct TileInfo { |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
44 uint x; ///< X position of the tile in unit coordinates |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
45 uint y; ///< Y position of the tile in unit coordinates |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
46 Slope tileh; ///< Slope of the tile |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
47 TileIndex tile; ///< Tile index |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
48 uint z; ///< Height |
8138
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
49 }; |
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
50 |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
51 /** Tile description for the 'land area information' tool */ |
8138
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
52 struct TileDesc { |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
53 StringID str; ///< Description of the tile |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
54 Owner owner[4]; ///< Name of the owner(s) |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
55 StringID owner_type[4]; ///< Type of each owner |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
56 Date build_date; ///< Date of construction of tile contents |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
57 StringID station_class; ///< Class of station |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
58 StringID station_name; ///< Type of station within the class |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
59 const char *grf; ///< newGRF used for the tile contents |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
60 uint64 dparam[2]; ///< Parameters of the \a str string |
8138
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
61 }; |
60ea0f95de91
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents:
8119
diff
changeset
|
62 |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
63 /** |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
64 * Tile callback function signature for drawing a tile and its contents to the screen |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
65 * @param ti Information about the tile to draw |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
66 */ |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
67 typedef void DrawTileProc(TileInfo *ti); |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
68 typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y); |
11090
df23c4e04638
(svn r15434) -Codechange: bit of type safety for the DC_xxx flags.
rubidium <rubidium@openttd.org>
parents:
10532
diff
changeset
|
69 typedef CommandCost ClearTileProc(TileIndex tile, DoCommandFlag flags); |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
70 |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
71 /** |
11799
3a6a820d27e2
(svn r16189) -Doc: Additions and improvement of (mainly) nested widgets/widget-parts doxygen docs.
alberth <alberth@openttd.org>
parents:
11090
diff
changeset
|
72 * Tile callback function signature for obtaining accepted cargo of a tile |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
73 * @param tile Tile queried for its accepted cargo |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
74 * @param res Storage destination of the cargo accepted |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
75 */ |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
76 typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res); |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
77 |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
78 /** |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
79 * Tile callback function signature for obtaining a tile description |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
80 * @param tile Tile being queried |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
81 * @param td Storage pointer for returned tile description |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
82 */ |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
83 typedef void GetTileDescProc(TileIndex tile, TileDesc *td); |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
84 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
85 /** |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
86 * Tile callback function signature for getting the possible tracks |
8616
9e46ac001a8c
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
frosch <frosch@openttd.org>
parents:
8596
diff
changeset
|
87 * that can be taken on a given tile by a given transport. |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
88 * |
8616
9e46ac001a8c
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
frosch <frosch@openttd.org>
parents:
8596
diff
changeset
|
89 * The return value contains the existing trackdirs and signal states. |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
90 * |
8616
9e46ac001a8c
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
frosch <frosch@openttd.org>
parents:
8596
diff
changeset
|
91 * see track_func.h for usage of TrackStatus. |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
92 * |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
93 * @param tile the tile to get the track status from |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
94 * @param mode the mode of transportation |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
95 * @param sub_mode used to differentiate between different kinds within the mode |
8616
9e46ac001a8c
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
frosch <frosch@openttd.org>
parents:
8596
diff
changeset
|
96 * @return the track status information |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
97 */ |
8616
9e46ac001a8c
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
frosch <frosch@openttd.org>
parents:
8596
diff
changeset
|
98 typedef TrackStatus GetTileTrackStatusProc(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side); |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
99 |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
100 /** |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
101 * Tile callback function signature for obtaining the produced cargo of a tile. |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
102 * @param tile Tile being queried |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
103 * @param b Destination array of produced cargo |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
104 */ |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
105 typedef void GetProducedCargoProc(TileIndex tile, CargoID *b); |
10532
d33755b6159a
(svn r14789) -Feature: allow scrolling with the left mouse button pressed (if enabled). Primarily useful for systems with touch screen (aapo)
rubidium <rubidium@openttd.org>
parents:
10496
diff
changeset
|
106 typedef bool ClickTileProc(TileIndex tile); |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
107 typedef void AnimateTileProc(TileIndex tile); |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
108 typedef void TileLoopProc(TileIndex tile); |
10207
c54d140df948
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium <rubidium@openttd.org>
parents:
9714
diff
changeset
|
109 typedef void ChangeTileOwnerProc(TileIndex tile, Owner old_owner, Owner new_owner); |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
110 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
111 /** @see VehicleEnterTileStatus to see what the return values mean */ |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
112 typedef VehicleEnterTileStatus VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y); |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
113 typedef Foundation GetFoundationProc(TileIndex tile, Slope tileh); |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
114 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
115 /** |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
116 * Tile callback function signature of the terraforming callback. |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
117 * |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
118 * The function is called when a tile is affected by a terraforming operation. |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
119 * It has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype. |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
120 * With DC_EXEC in \a flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself). |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
121 * |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
122 * @note The terraforming has not yet taken place. So GetTileZ() and GetTileSlope() refer to the landscape before the terraforming operation. |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
123 * |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
124 * @param tile The involved tile. |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
125 * @param flags Command flags passed to the terraform command (DC_EXEC, DC_QUERY_COST, etc.). |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
126 * @param z_new TileZ after terraforming. |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
127 * @param tileh_new Slope after terraforming. |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
128 * @return Error code or extra cost for terraforming (like clearing land, building foundations, etc., but not the terraforming itself.) |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
129 */ |
11090
df23c4e04638
(svn r15434) -Codechange: bit of type safety for the DC_xxx flags.
rubidium <rubidium@openttd.org>
parents:
10532
diff
changeset
|
130 typedef CommandCost TerraformTileProc(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new); |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
131 |
10233
63a58f4b2607
(svn r14461) -Document: add some doxygen comments (Albert)
rubidium <rubidium@openttd.org>
parents:
10208
diff
changeset
|
132 /** |
63a58f4b2607
(svn r14461) -Document: add some doxygen comments (Albert)
rubidium <rubidium@openttd.org>
parents:
10208
diff
changeset
|
133 * Set of callback functions for performing tile operations of a given tile type. |
63a58f4b2607
(svn r14461) -Document: add some doxygen comments (Albert)
rubidium <rubidium@openttd.org>
parents:
10208
diff
changeset
|
134 * @see TileType */ |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
135 struct TileTypeProcs { |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
136 DrawTileProc *draw_tile_proc; ///< Called to render the tile and its contents to the screen |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
137 GetSlopeZProc *get_slope_z_proc; |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
138 ClearTileProc *clear_tile_proc; |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
139 GetAcceptedCargoProc *get_accepted_cargo_proc; ///< Return accepted cargo of the tile |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
140 GetTileDescProc *get_tile_desc_proc; ///< Get a description of a tile (for the 'land area information' tool) |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
141 GetTileTrackStatusProc *get_tile_track_status_proc; ///< Get available tracks and status of a tile |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
142 ClickTileProc *click_tile_proc; ///< Called when tile is clicked |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
143 AnimateTileProc *animate_tile_proc; |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
144 TileLoopProc *tile_loop_proc; |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
145 ChangeTileOwnerProc *change_tile_owner_proc; |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
146 GetProducedCargoProc *get_produced_cargo_proc; ///< Return produced cargo of the tile |
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
147 VehicleEnterTileProc *vehicle_enter_tile_proc; ///< Called when a vehicle enters a tile |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
148 GetFoundationProc *get_foundation_proc; |
10260
d23fed9a51e2
(svn r14491) -Documentation: updates/additions of doxygen docs (Alberth)
rubidium <rubidium@openttd.org>
parents:
10233
diff
changeset
|
149 TerraformTileProc *terraform_tile_proc; ///< Called when a terraforming operation is about to take place |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
150 }; |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
151 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
152 extern const TileTypeProcs * const _tile_type_procs[16]; |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
153 |
8616
9e46ac001a8c
(svn r12199) -Codechange: Remove magic around the results of GetTileTrackStatus().
frosch <frosch@openttd.org>
parents:
8596
diff
changeset
|
154 TrackStatus GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side = INVALID_DIAGDIR); |
10496
4957395bd611
(svn r14751) -Codechange: put VehicleEnterTile declaration where it should be and use correct return type
smatz <smatz@openttd.org>
parents:
10260
diff
changeset
|
155 VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y); |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
156 void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac); |
10207
c54d140df948
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium <rubidium@openttd.org>
parents:
9714
diff
changeset
|
157 void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner); |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
158 void AnimateTile(TileIndex tile); |
10532
d33755b6159a
(svn r14789) -Feature: allow scrolling with the left mouse button pressed (if enabled). Primarily useful for systems with touch screen (aapo)
rubidium <rubidium@openttd.org>
parents:
10496
diff
changeset
|
159 bool ClickTile(TileIndex tile); |
8119
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
160 void GetTileDesc(TileIndex tile, TileDesc *td); |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
161 |
b6ec923e9fa8
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
162 #endif /* TILE_CMD_H */ |