Overseer
Public Member Functions | List of all members
Overseer::Region Class Reference

A region handler. More...

#include "Region.h"

Public Member Functions

 Region ()
 default constructor.
 
 Region (size_t regionId, std::shared_ptr< TilePosition > tilePosition)
 constructor. More...
 
size_t getArea () const
 Gets the number of points within the region, which corresponds to it's area. More...
 
const std::vector< UnitPosition > getNeutralUnitPositions ()
 Returns the edges of the region. More...
 
size_t getId () const
 Get region id. More...
 
void setId (size_t regionId)
 set the region id (INTERNAL USE ONLY) More...
 
std::vector< TilePosition > getTilePositions () const
 Get the tile positions within the region. More...
 
std::vector< sc2::Point2D > getPoints () const
 Gets all mid points from all tiles within this region. More...
 
void addTilePosition (std::shared_ptr< TilePosition > tilePosition)
 Add tile position to region. More...
 
void addTilePosition (TilePosition &tilePosition)
 Add tile position to region. More...
 
double getLargestDistanceToUnpathable () const
 get the longest path to a unpathable. More...
 
sc2::Point2D getMidPoint () const
 Get the mid point of this region. More...
 
void merge (Region region)
 Merges two regions (INTERNAL USE ONLY). More...
 
void clear ()
 clear this region of its tile positions (INTERNAL USE ONLY).
 

Detailed Description

A region handler.

Constructor & Destructor Documentation

◆ Region()

Overseer::Region::Region ( size_t  regionId,
std::shared_ptr< TilePosition >  tilePosition 
)

constructor.

Parameters
regionIdThe id a region
tilePositionA tileposition within the region.

Member Function Documentation

◆ addTilePosition() [1/2]

void Overseer::Region::addTilePosition ( std::shared_ptr< TilePosition >  tilePosition)

Add tile position to region.

Parameters
thetile position to add.

◆ addTilePosition() [2/2]

void Overseer::Region::addTilePosition ( TilePosition &  tilePosition)

Add tile position to region.

Parameters
thetile position to add.

◆ getArea()

size_t Overseer::Region::getArea ( ) const

Gets the number of points within the region, which corresponds to it's area.

Returns
The number of tile positiions within the region.

◆ getId()

size_t Overseer::Region::getId ( ) const

Get region id.

Returns
This region id

◆ getLargestDistanceToUnpathable()

double Overseer::Region::getLargestDistanceToUnpathable ( ) const

get the longest path to a unpathable.

Returns
the path.

◆ getMidPoint()

sc2::Point2D Overseer::Region::getMidPoint ( ) const

Get the mid point of this region.

Returns
region mid point

◆ getNeutralUnitPositions()

const std::vector< UnitPosition > Overseer::Region::getNeutralUnitPositions ( )

Returns the edges of the region.

Returns
vector with edges. Returns the units and positions occupying the region
const vector with unit positions.

◆ getPoints()

std::vector< sc2::Point2D > Overseer::Region::getPoints ( ) const

Gets all mid points from all tiles within this region.

Returns
vector the sc2::Point2D

◆ getTilePositions()

std::vector< TilePosition > Overseer::Region::getTilePositions ( ) const

Get the tile positions within the region.

Returns
vector with tileposition.

◆ merge()

void Overseer::Region::merge ( Region  region)

Merges two regions (INTERNAL USE ONLY).

Parameters
regionThe region to merge with THIS region.

◆ setId()

void Overseer::Region::setId ( size_t  regionId)

set the region id (INTERNAL USE ONLY)

Parameters
theid to set

The documentation for this class was generated from the following files: