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