1 #ifndef _OVERSEER_MAP_H_ 2 #define _OVERSEER_MAP_H_ 5 #include "spatial/box_multimap.hpp" 6 #include "spatial/neighbor_iterator.hpp" 7 #include "spatial/ordered_iterator.hpp" 11 typedef spatial::box_multimap<2, sc2::Point2D, std::shared_ptr<Tile>, spatial::accessor_less<accessors::point2d_accessor, sc2::Point2D>> TilePositionContainer;
12 typedef spatial::box_multimap<2, sc2::Point2D, sc2::Unit*, spatial::accessor_less<accessors::point2d_accessor, sc2::Point2D>> UnitPositionContainer;
13 typedef std::map<size_t, std::shared_ptr<Region>> RegionMap;
14 typedef std::map<std::pair<size_t,size_t>, std::vector<TilePosition>> RawFrontier;
56 std::vector<std::shared_ptr<Region>>
getRegions();
80 void addTile(sc2::Point2D& pos, std::shared_ptr<Tile> tile);
87 bool valid(sc2::Point2D pos)
const;
110 std::shared_ptr<Tile>
getTile(sc2::Point2D pos);
159 void setBot(sc2::Agent* bot);
180 sc2::Agent*
getBot()
const {
return m_bot; }
184 std::pair<size_t, size_t> findNeighboringRegions(std::shared_ptr<TilePosition> tilePosition);
187 static std::unique_ptr<Map> m_gInstance;
189 UnitPositionContainer m_unitPositions;
190 TilePositionContainer m_tilePositions;
191 std::vector<std::shared_ptr<TilePosition>> m_buildableTiles;
193 std::vector<std::shared_ptr<TilePosition>> m_frontierPositions;
194 RawFrontier m_rawFrontier;
196 sc2::Point2D m_maxPlayable;
197 sc2::Point2D m_minPlayable;
198 sc2::Point2D m_centerPlayable;
const Region * getNearestRegion(sc2::Point2D pos)
Gets closest region to a specific point.
Definition: Map.cpp:40
std::vector< TilePosition > getGeysers()
Get all tilePosition for Geysers.
Definition: Map.cpp:115
std::vector< TilePosition > getXelNagas()
Get all tilePosition for Xel'nagas watch towers.
Definition: Map.cpp:103
size_t getWidth() const
Gets the map width.
Definition: Map.cpp:23
RawFrontier getRawFrontier() const
region pair and frontier map.
Definition: Map.cpp:98
void addRegion(Region region)
Apends a region to the container.
Definition: Map.cpp:69
std::shared_ptr< Tile > getTile(sc2::Point2D pos)
Gets a tile based on the position.
Definition: Map.cpp:73
Definition: ChokePoint.cpp:3
std::vector< std::shared_ptr< TilePosition > > getFrontierPositions() const
Get tiles that is between two regions.
Definition: Map.cpp:93
Map()
Simple default constructor does no initzalation.
Definition: Map.cpp:10
std::vector< TilePosition > getMinerals()
Get all tilePosition for Minerals.
Definition: Map.cpp:127
void addTile(sc2::Point2D &pos, std::shared_ptr< Tile > tile)
Apends a tile to container.
Definition: Map.cpp:53
A region handler.
Definition: Region.h:67
is the overseer map that holds the most "important" functionality for a outside user.
Definition: Map.h:22
std::vector< std::shared_ptr< Region > > getRegions()
Gets all the regions found.
Definition: Map.cpp:28
size_t size() const
Gets the size of the tile position container.
Definition: Map.cpp:77
size_t getHeight() const
Definition: Map.cpp:18
sc2::Agent * getBot() const
Gets the set agent.
Definition: Map.h:180
std::vector< TilePosition > getDestructibles()
Get tilePositions for Destructible objects.
Definition: Map.cpp:139
TilePositionContainer getTilePositions() const
Get all tile positions.
Definition: Map.cpp:82
void setBot(sc2::Agent *bot)
set the bot into overseer
Definition: Map.cpp:87
bool valid(sc2::Point2D pos) const
Check if a position is on map.
Definition: Map.cpp:57
TilePosition getClosestTilePosition(sc2::Point2D pos) const
Get the closest tile position.
Definition: Map.cpp:62
Region * getRegion(size_t id)
Get a specific region.
Definition: Map.cpp:38