10 #include "basetypes.h" 13 #include <unordered_map> 14 #include <unordered_set> 77 bool isMyBase =
false;
83 bool isEnemyBase =
false;
88 bool isPossibleEnemyStartLocation =
false;
90 bool wasMyBase =
false;
92 bool wasEnemyBase =
false;
93 bool hasMyBuildings =
false;
94 bool hasEnemyBuildings =
false;
96 double myGndStrength = 0;
98 double myAirStrength = 0;
100 double myDetStrength = 0;
101 double enemyGndStrength = 0;
102 double enemyAirStrength = 0;
103 double enemyDetStrength = 0;
124 float saturation = 0.0f;
133 std::vector<Area>
const& areas()
const;
134 Area& getArea(
int id);
135 Area const& getArea(
int id)
const;
139 Area const& getArea(
Tile const& tile)
const;
140 Area* tryGetArea(
int id);
141 Area const* tryGetArea(
int id)
const;
145 int numMyBases()
const;
147 const BaseInfo* myBase(
int n)
const;
149 std::vector<BaseInfo>
const& myBases()
const;
151 bool foundMyStartLocation()
const;
156 int myClosestBaseIdx(
Position const& p)
const;
157 std::vector<Unit*> myBaseResources(
int n)
const;
159 int numEnemyBases()
const;
161 const BaseInfo* enemyBase(
int n)
const;
163 bool foundEnemyStartLocation()
const;
166 Position enemyStartLocation()
const;
168 std::vector<Position>
const& candidateEnemyStartLocations()
const;
173 std::vector<Position>
179 std::vector<Area const*>
187 void findMyStartLocation();
188 void initializePossibleEnemyLocations();
192 int findBaseLocationIndexInArea(
Unit* unit,
Area& area);
194 void updateEnemyStartLocations();
195 void updateStrengths();
196 void updateNeighbors();
198 void populateCache();
201 bool isMyBaseAlive(
const BaseInfo& baseInfo)
const;
202 bool isEnemyBaseAlive(
const BaseInfo& baseInfo)
const;
207 std::vector<Area const*>* areas,
208 std::vector<Position>* chokePoints,
209 float* length)
const;
211 State* state_ =
nullptr;
212 BWEM::Map* map_ =
nullptr;
213 std::vector<Area> areas_;
214 std::vector<Position> candidateEnemyStartLoc_;
216 std::vector<BaseInfo> myBases_;
217 std::vector<BaseInfo> enemyBases_;
218 std::unordered_map<Unit*, BaseInfo*> myDepot2Base_;
219 std::unordered_map<Unit*, BaseInfo*> enemyDepot2Base_;
220 std::unordered_set<Unit*> macroDepots_;
221 std::unordered_map<int, int> neighborAreaCache_;
BWEM::Area const * area
Definition: areainfo.h:65
Game state.
Definition: state.h:42
int FrameNum
Definition: basetypes.h:22
std::vector< Unit * > geysers
All Geysers/Extractors/Refineries/Assimilators in this area.
Definition: areainfo.h:60
Position topLeft
Top left of the area's bounding box in walk tiles.
Definition: areainfo.h:46
std::vector< Position > baseLocations
Possible base locations.
Definition: areainfo.h:52
Area * area
Area to which the base belongs.
Definition: areainfo.h:116
std::vector< Unit * > liveUnits
All units in this area that are not dead. This includes gone units.
Definition: areainfo.h:54
std::vector< Area * > neighbors
Accessible neighbors.
Definition: areainfo.h:70
Unit * resourceDepot
Resource depot constructed on the base.
Definition: areainfo.h:120
void initialize()
Definition: buildtype.cpp:500
Definition: areainfo.h:114
Represents an area on the map.
Definition: areainfo.h:38
Represents a unit in the game.
Definition: unitsinfo.h:35
int baseId
Base index within the area, which corresponds to the build location.
Definition: areainfo.h:118
std::vector< Unit * > minerals
All Minerals in this area.
Definition: areainfo.h:58
constexpr Position kInvalidPosition
Definition: basetypes.h:179
Position bottomRight
Bottom right of the area's bounding box in walk tiles.
Definition: areainfo.h:48
Represents a tile on the map.
Definition: tilesinfo.h:29
std::vector< Unit * > visibleUnits
All units in this area that are currently visible.
Definition: areainfo.h:56
Definition: areainfo.h:17
Main namespace for bot-related code.
Definition: areainfo.cpp:17
Access point for area and base information.
Definition: areainfo.h:112