00001 /* $Id: ai_map.hpp 15101 2009-01-16 00:05:26Z truebrain $ */ 00002 00005 #ifndef AI_MAP_HPP 00006 #define AI_MAP_HPP 00007 00008 #include "ai_object.hpp" 00009 00013 class AIMap : public AIObject { 00014 public: 00015 #ifdef DEFINE_SCRIPT_FILES 00016 enum MapType { 00017 TILE_INVALID = INVALID_TILE, 00018 }; 00019 #endif /* DEFINE_SCRIPT_FILES */ 00020 00021 static const char *GetClassName() { return "AIMap"; } 00022 00028 static bool IsValidTile(TileIndex tile); 00029 00035 static TileIndex GetMapSize(); 00036 00042 static uint32 GetMapSizeX(); 00043 00049 static uint32 GetMapSizeY(); 00050 00058 static int32 GetTileX(TileIndex tile); 00059 00067 static int32 GetTileY(TileIndex tile); 00068 00077 static TileIndex GetTileIndex(uint32 x, uint32 y); 00078 00088 static int32 DistanceManhattan(TileIndex tile_from, TileIndex tile_to); 00089 00100 static int32 DistanceMax(TileIndex tile_from, TileIndex tile_to); 00101 00112 static int32 DistanceSquare(TileIndex tile_from, TileIndex tile_to); 00113 00120 static int32 DistanceFromEdge(TileIndex tile); 00121 }; 00122 00123 #endif /* AI_MAP_HPP */