57 * @return true if it is buildable, false if not. |
57 * @return true if it is buildable, false if not. |
58 */ |
58 */ |
59 static bool IsBuildable(TileIndex tile); |
59 static bool IsBuildable(TileIndex tile); |
60 |
60 |
61 /** |
61 /** |
|
62 * Check if this tile is buildable in a rectangle around a tile, with the entry in the list as top-left. |
|
63 * @note Road and rail are considered buildable. |
|
64 * @param tile the tile to check on. |
|
65 * @param width the width of the rectangle. |
|
66 * @param height the height of the rectangle. |
|
67 * @pre AIMap::IsValidTile(tile). |
|
68 * @return true if it is buildable, false if not. |
|
69 */ |
|
70 static bool IsBuildableRectangle(TileIndex tile, uint width, uint height); |
|
71 |
|
72 /** |
62 * Check if a tile is water. |
73 * Check if a tile is water. |
63 * @param tile the tile to check on. |
74 * @param tile the tile to check on. |
64 * @pre AIMap::IsValidTile(tile). |
75 * @pre AIMap::IsValidTile(tile). |
65 * @return true if it is water, false if not. |
76 * @return true if it is water, false if not. |
66 */ |
77 */ |
110 * @note town(houses) are not included in the value. |
121 * @note town(houses) are not included in the value. |
111 */ |
122 */ |
112 static int32 GetCargoProduction(TileIndex tile, CargoID cargo_type, uint width, uint height, uint radius); |
123 static int32 GetCargoProduction(TileIndex tile, CargoID cargo_type, uint width, uint height, uint radius); |
113 |
124 |
114 /** |
125 /** |
|
126 * Get the manhattan distance from the tile to the tile. |
|
127 * @param tile_from The tile to get the distance to. |
|
128 * @param tile_to The tile to get the distance to. |
|
129 * @return The distance between the two tiles. |
|
130 */ |
|
131 static int32 GetDistanceManhattanToTile(TileIndex tile_from, TileIndex tile_to); |
|
132 |
|
133 /** |
|
134 * Get the square distance from the tile to the tile. |
|
135 * @param tile_from The tile to get the distance to. |
|
136 * @param tile_to The tile to get the distance to. |
|
137 * @return The distance between the two tiles. |
|
138 */ |
|
139 static int32 GetDistanceSquareToTile(TileIndex tile_from, TileIndex tile_to); |
|
140 |
|
141 /** |
115 * Raise the given corners of the tile. The corners can be combined, |
142 * Raise the given corners of the tile. The corners can be combined, |
116 * for example: SLOPE_N | SLOPE_W (= SLOPE_NW) |
143 * for example: SLOPE_N | SLOPE_W (= SLOPE_NW) |
117 * @param tile the tile to raise. |
144 * @param tile the tile to raise. |
118 * @param slope corners to raise (SLOPE_xxx). |
145 * @param slope corners to raise (SLOPE_xxx). |
119 * @pre AIMap::IsValidTile(tile). |
146 * @pre AIMap::IsValidTile(tile). |