00001 /* $Id$ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. 00006 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00007 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. 00008 */ 00009 00012 #ifndef AI_MAP_HPP 00013 #define AI_MAP_HPP 00014 00015 #include "ai_object.hpp" 00016 #include "../../tile_type.h" 00017 00021 class AIMap : public AIObject { 00022 public: 00023 static const int TILE_INVALID = (int)INVALID_TILE; 00024 00026 static const char *GetClassName() { return "AIMap"; } 00027 00033 static bool IsValidTile(TileIndex tile); 00034 00040 static TileIndex GetMapSize(); 00041 00047 static uint32 GetMapSizeX(); 00048 00054 static uint32 GetMapSizeY(); 00055 00063 static int32 GetTileX(TileIndex tile); 00064 00072 static int32 GetTileY(TileIndex tile); 00073 00082 static TileIndex GetTileIndex(uint32 x, uint32 y); 00083 00093 static int32 DistanceManhattan(TileIndex tile_from, TileIndex tile_to); 00094 00105 static int32 DistanceMax(TileIndex tile_from, TileIndex tile_to); 00106 00117 static int32 DistanceSquare(TileIndex tile_from, TileIndex tile_to); 00118 00125 static int32 DistanceFromEdge(TileIndex tile); 00126 }; 00127 00128 #endif /* AI_MAP_HPP */