BWAPI
|
00001 #pragma once 00002 00003 #include "UnitCommand.h" 00004 #include "ForceData.h" 00005 #include "PlayerData.h" 00006 #include "UnitData.h" 00007 #include "BulletData.h" 00008 #include "Event.h" 00009 #include "Command.h" 00010 #include "Shape.h" 00011 namespace BWAPIC 00012 { 00013 struct Position 00014 { 00015 Position() {x=0;y=0;} 00016 int x; 00017 int y; 00018 }; 00019 } 00020 namespace BWAPI 00021 { 00022 struct unitFinder 00023 { 00024 int unitIndex; 00025 int searchValue; 00026 }; 00027 struct GameData 00028 { 00029 GameData() {} 00030 //revision and debug will stay at the top of struct so they don't move in memory from revision to revision. 00031 int revision; 00032 bool isDebug; 00033 00034 int instanceID; 00035 int botAPM_noselects; 00036 int botAPM_selects; 00037 00038 //forces 00039 int forceCount; 00040 ForceData forces[5]; 00041 00042 //players 00043 int playerCount; 00044 PlayerData players[12]; 00045 00046 //units 00047 int initialUnitCount; 00048 UnitData units[10000]; 00049 00050 //unit table 00051 int unitArray[1700]; 00052 00053 //bullets 00054 BulletData bullets[100]; 00055 00056 // nuke dots 00057 int nukeDotCount; 00058 BWAPIC::Position nukeDots[200]; 00059 00060 int gameType; 00061 int latency; 00062 int latencyFrames; 00063 int latencyTime; 00064 int remainingLatencyFrames; 00065 int remainingLatencyTime; 00066 bool hasLatCom; 00067 int replayFrameCount; 00068 int frameCount; 00069 int elapsedTime; 00070 int fps; 00071 double averageFPS; 00072 00073 // user input 00074 int mouseX; 00075 int mouseY; 00076 bool mouseState[3]; 00077 bool keyState[256]; 00078 int screenX; 00079 int screenY; 00080 00081 bool flags[2]; 00082 00083 // map 00084 int mapWidth; 00085 int mapHeight; 00086 char mapFileName[261]; //size based on broodwar memory 00087 char mapPathName[261]; //size based on broodwar memory 00088 char mapName[33]; //size based on broodwar memory 00089 char mapHash[41]; 00090 00091 //tile data 00092 int getGroundHeight[256][256]; 00093 bool isWalkable[1024][1024]; 00094 bool isBuildable[256][256]; 00095 bool isVisible[256][256]; 00096 bool isExplored[256][256]; 00097 bool hasCreep[256][256]; 00098 bool isOccupied[256][256]; 00099 00100 unsigned short mapTileRegionId[256][256]; 00101 unsigned short mapSplitTilesMiniTileMask[5000]; 00102 unsigned short mapSplitTilesRegion1[5000]; 00103 unsigned short mapSplitTilesRegion2[5000]; 00104 unsigned short regionGroupIndex[5000]; 00105 00106 // start locations 00107 int startLocationCount; 00108 BWAPIC::Position startLocations[8]; 00109 00110 // match mode 00111 bool isInGame; 00112 bool isMultiplayer; 00113 bool isBattleNet; 00114 bool isPaused; 00115 bool isReplay; 00116 00117 //selected units 00118 int selectedUnitCount; 00119 int selectedUnits[12]; 00120 00121 // players 00122 int self; 00123 int enemy; 00124 int neutral; 00125 00126 static const int MAX_EVENTS = 10000; 00127 static const int MAX_STRINGS = 20000; 00128 static const int MAX_SHAPES = 20000; 00129 static const int MAX_COMMANDS = 20000; 00130 static const int MAX_UNIT_COMMANDS = 20000; 00131 00132 //events from server to client 00133 int eventCount; 00134 BWAPIC::Event events[MAX_EVENTS]; 00135 00136 //strings (used in events, shapes, and commands) 00137 int stringCount; 00138 char strings[MAX_STRINGS][256]; 00139 00140 //shapes, commands, unitCommands, from client to server 00141 int shapeCount; 00142 BWAPIC::Shape shapes[MAX_SHAPES]; 00143 00144 int commandCount; 00145 BWAPIC::Command commands[MAX_COMMANDS]; 00146 00147 int unitCommandCount; 00148 BWAPIC::UnitCommand unitCommands[MAX_UNIT_COMMANDS]; 00149 00150 unitFinder xUnitSearch[1700*2]; 00151 unitFinder yUnitSearch[1700*2]; 00152 }; 00153 }