1 #ifndef _OVERSEER_REGION_H_ 2 #define _OVERSEER_REGION_H_ 11 #include "spatial/box_multimap.hpp" 12 #include "spatial/neighbor_iterator.hpp" 13 #include "spatial/ordered_iterator.hpp" 14 #include "sc2api/sc2_api.h" 22 typedef std::pair<sc2::Point2D, std::shared_ptr<Tile>> TilePosition;
23 typedef std::pair<sc2::Point2D, sc2::Unit *> UnitPosition;
24 typedef std::pair<sc2::Point2D, sc2::Point2D> PointPair;
31 bool operator()(
const PointPair &l,
const PointPair &r)
const;
40 bool operator()(std::shared_ptr<TilePosition> &a, std::shared_ptr<TilePosition> &b)
const;
48 bool operator()(TilePosition &a, TilePosition &b)
const;
81 Region(
size_t regionId, std::shared_ptr<TilePosition> tilePosition);
88 size_t getArea()
const;
102 const std::vector<UnitPosition> getNeutralUnitPositions();
109 size_t getId()
const;
116 void setId(
size_t regionId);
123 std::vector<TilePosition> getTilePositions()
const;
130 std::vector<sc2::Point2D> getPoints()
const;
137 void addTilePosition(std::shared_ptr<TilePosition> tilePosition);
144 void addTilePosition(TilePosition& tilePosition);
151 double getLargestDistanceToUnpathable()
const;
158 sc2::Point2D getMidPoint()
const;
165 void merge(
Region region);
173 std::vector<TilePosition> m_tilePositions;
175 std::vector<UnitPosition> m_neutralUnitPositions;
177 sc2::Point2D m_midPoint;
179 std::map<PointPair, float, ComparePointPairs> m_pointDistances;
181 float m_largestDistUnpathable;
Definition: ChokePoint.cpp:3
sort on distance to nerearest unpathable.
Definition: Region.h:47
Check if two PointPairs are equal.
Definition: Region.h:30
A region handler.
Definition: Region.h:67
sort on distance to nerearest unpathable.
Definition: Region.h:39