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

Class that is used as a chokepoint container with size and positioning on the map. More...

#include "ChokePoint.h"

Public Member Functions

 ChokePoint (const Region *region1, const Region *region2, size_t cp_id, std::vector< TilePosition > tilePositions)
 class Constructor More...
 
std::pair< const Region *, const Region * > getRegions () const
 Gets the regions where a chokepoint exists between them. More...
 
size_t size () const
 Get the size of the found chokepoint. More...
 
sc2::Point2D getMidPoint () const
 Gets the mid point of the chokepoint. More...
 
std::vector< sc2::Point2D > getPoints () const
 Get the points within the chokepoint. More...
 
std::vector< TilePosition > getTilePositions () const
 Get the tile positions inside the chokePoint. More...
 
ChokePointId getId () const
 Get the id of the chokepoint. More...
 
bool operator== (const ChokePoint &rhs) const
 How two chokepoints will be check if equal.
 
bool adjacent (ChokePoint &cp) const
 check if this chokepoint share a region with chokepoint cp. More...
 
std::string getStringId () const
 Gets the chokepoint id as a string. More...
 
size_t getChokePointId () const
 Gets the chokepoints position between two regions (INTERNAL USE ONLY).
 

Detailed Description

Class that is used as a chokepoint container with size and positioning on the map.

Constructor & Destructor Documentation

◆ ChokePoint()

Overseer::ChokePoint::ChokePoint ( const Region region1,
const Region region2,
size_t  cp_id,
std::vector< TilePosition >  tilePositions 
)

class Constructor

Parameters
region1is a adjecent region to region2
region2is a adjecent region to region1
Theposition of the chokepoint between region1 and region2 starts at zero.
tilePositionsis the "limits" between region1 and region2

Member Function Documentation

◆ adjacent()

bool Overseer::ChokePoint::adjacent ( ChokePoint cp) const

check if this chokepoint share a region with chokepoint cp.

Parameters
cpanother chokepoint
Returns
true if they share a region, otherwise false.

◆ getId()

ChokePointId Overseer::ChokePoint::getId ( ) const

Get the id of the chokepoint.

Returns
chokepoint id.

◆ getMidPoint()

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

Gets the mid point of the chokepoint.

Returns
The mid point of the chokepoint

◆ getPoints()

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

Get the points within the chokepoint.

Returns
vector containing chokepoint positions

◆ getRegions()

std::pair< const Region *, const Region * > Overseer::ChokePoint::getRegions ( ) const

Gets the regions where a chokepoint exists between them.

Returns
pair containing adjecent region pointers with chokepoint between them

◆ getStringId()

std::string Overseer::ChokePoint::getStringId ( ) const

Gets the chokepoint id as a string.

Returns
string version of chokepoint id.

◆ getTilePositions()

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

Get the tile positions inside the chokePoint.

Returns
vector containing tile positions.

◆ size()

size_t Overseer::ChokePoint::size ( ) const

Get the size of the found chokepoint.

Returns
The size of the chokepoint

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