diff options
author | truebrain <truebrain@openttd.org> | 2009-01-16 15:01:54 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2009-01-16 15:01:54 +0000 |
commit | dec721ca6f0e9e7f869f51f293a5b729fd22574d (patch) | |
tree | 451b86c6aef617597b05ec5ba55d6abcb5632da0 /src/ai/api/ai_tile.hpp | |
parent | 47406dbc696fc0630e3801080d0c2d491f404f24 (diff) | |
download | openttd-dec721ca6f0e9e7f869f51f293a5b729fd22574d.tar.xz |
(svn r15109) -Add [NoAI]: add AITile::LevelTiles (Yexo)
Diffstat (limited to 'src/ai/api/ai_tile.hpp')
-rw-r--r-- | src/ai/api/ai_tile.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ai/api/ai_tile.hpp b/src/ai/api/ai_tile.hpp index 151771cae..9a4df1677 100644 --- a/src/ai/api/ai_tile.hpp +++ b/src/ai/api/ai_tile.hpp @@ -313,6 +313,24 @@ public: static bool LowerTile(TileIndex tile, int32 slope); /** + * Level all tiles in the rectangle between start_tile and end_tile so they + * are at the same height. All tiles will be raised or lowered until + * they are at height AITile::GetHeight(start_tile). + * @param start_tile One corner of the rectangle to level. + * @param end_tile The opposite corner of the rectangle. + * @pre start_tile < AIMap::GetMapSize(). + * @pre end_tile < AIMap::GetMapSize(). + * @exception AIError::ERR_AREA_NOT_CLEAR + * @exception AIError::ERR_TOO_CLOSE_TO_EDGE + * @return True if and only if the area was completely leveled. + * @note Even if leveling some part fails, some other part may have been + * succesfully leveled already. + * @note This function may return true in AITestMode, although it fails in + * AIExecMode. + */ + static bool LevelTiles(TileIndex start_tile, TileIndex end_tile); + + /** * Destroy everything on the given tile. * @param tile The tile to demolish. * @pre AIMap::IsValidTile(tile). |