BWAPI
|
00001 #pragma once 00002 00003 #include <string> 00004 #include <Util/RectangleArray.h> 00005 #include <BW/Offsets.h> 00006 00007 namespace BWAPI 00008 { 00014 class Map 00015 { 00016 public : 00017 Map(); 00018 ~Map(); 00020 static std::string getFileName(); 00021 static std::string getPathName(); 00022 static std::string getName(); 00023 00025 static u16 getWidth(); 00026 00028 static u16 getHeight(); 00029 00030 bool buildable(int x, int y) const; 00031 bool walkable(int x, int y) const; 00032 bool visible(int x, int y) const; 00033 bool isExplored(int x, int y) const; 00034 bool hasCreep(int x, int y) const; 00035 bool isOccupied(int x, int y) const; 00036 int groundHeight(int x, int y) const; 00037 00039 void load(); 00040 00042 static std::string getMapHash(); 00043 void copyToSharedMemory(); 00044 00045 private : 00046 static BW::TileID getTile(int x, int y); 00047 static u8 getTileVariation(BW::TileID); 00048 u16 getMiniTile(int x, int y) const; 00049 Util::RectangleArray<BW::activeTile> *activeTiles; 00050 Util::RectangleArray<bool> buildability; 00051 Util::RectangleArray<bool> walkability; 00052 void setBuildability(); 00053 void setWalkability(); 00054 }; 00055 };