TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Classes | Public Member Functions | List of all members
cherrypi::AreaInfo Class Reference

Access point for area and base information. More...

#include <areainfo.h>

Classes

struct  BaseInfo
 

Public Member Functions

 AreaInfo (State *state)
 
 AreaInfo (AreaInfo const &)=delete
 
AreaInfooperator= (AreaInfo const &)=delete
 
void update ()
 
std::vector< Area > const & areas () const
 
AreagetArea (int id)
 
Area const & getArea (int id) const
 
AreagetArea (Position p)
 
Area const & getArea (Position p) const
 
AreagetArea (Tile const &tile)
 
Area const & getArea (Tile const &tile) const
 
AreatryGetArea (int id)
 
Area const * tryGetArea (int id) const
 
AreatryGetArea (Position p)
 
Area const * tryGetArea (Position p) const
 
int numMyBases () const
 
const BaseInfomyBase (int n) const
 Returns data for our n-th base. More...
 
std::vector< BaseInfo > const & myBases () const
 Returns data for all our bases. More...
 
bool foundMyStartLocation () const
 Returns true, if our start location is known. More...
 
Position myStartLocation () const
 Returns our start location if it is known, otherwise returns kInvalidPosition. More...
 
int myClosestBaseIdx (Position const &p) const
 Returns the closest base according to Euclidean distance. More...
 
std::vector< Unit * > myBaseResources (int n) const
 
int numEnemyBases () const
 
const BaseInfoenemyBase (int n) const
 Returns data for enemy's n-th base. More...
 
bool foundEnemyStartLocation () const
 Returns true, if enemy start location is known. More...
 
Position enemyStartLocation () const
 Returns enemy start location if it is known, otherwise returns kInvalidPosition. More...
 
std::vector< Position > const & candidateEnemyStartLocations () const
 
std::vector< PositionwalkPath (Position a, Position b, float *length=nullptr) const
 Returns a path of choke points to walk from a to b. More...
 
std::vector< Area const * > walkPathAreas (Position a, Position b, float *length=nullptr) const
 Returns a path of areas to walk from a to b. More...
 
float walkPathLength (Position a, Position b) const
 Returns the distance in walktiles for a walking path a to b. More...
 

Detailed Description

Access point for area and base information.

Beside providing access to area information, this class also provides a few convenience wrappers for functionality in BWEM::Map.

Constructor & Destructor Documentation

cherrypi::AreaInfo::AreaInfo ( State state)
cherrypi::AreaInfo::AreaInfo ( AreaInfo const &  )
delete

Member Function Documentation

std::vector< Area > const & cherrypi::AreaInfo::areas ( ) const
std::vector< Position > const & cherrypi::AreaInfo::candidateEnemyStartLocations ( ) const
const AreaInfo::BaseInfo * cherrypi::AreaInfo::enemyBase ( int  n) const

Returns data for enemy's n-th base.

Position cherrypi::AreaInfo::enemyStartLocation ( ) const

Returns enemy start location if it is known, otherwise returns kInvalidPosition.

bool cherrypi::AreaInfo::foundEnemyStartLocation ( ) const

Returns true, if enemy start location is known.

bool cherrypi::AreaInfo::foundMyStartLocation ( ) const

Returns true, if our start location is known.

Area & cherrypi::AreaInfo::getArea ( int  id)
Area const & cherrypi::AreaInfo::getArea ( int  id) const
Area & cherrypi::AreaInfo::getArea ( Position  p)
Area const & cherrypi::AreaInfo::getArea ( Position  p) const
Area & cherrypi::AreaInfo::getArea ( Tile const &  tile)
Area const & cherrypi::AreaInfo::getArea ( Tile const &  tile) const
const AreaInfo::BaseInfo * cherrypi::AreaInfo::myBase ( int  n) const

Returns data for our n-th base.

std::vector< Unit * > cherrypi::AreaInfo::myBaseResources ( int  n) const
std::vector< AreaInfo::BaseInfo > const & cherrypi::AreaInfo::myBases ( ) const

Returns data for all our bases.

int cherrypi::AreaInfo::myClosestBaseIdx ( Position const &  p) const

Returns the closest base according to Euclidean distance.

Position cherrypi::AreaInfo::myStartLocation ( ) const

Returns our start location if it is known, otherwise returns kInvalidPosition.

int cherrypi::AreaInfo::numEnemyBases ( ) const
int cherrypi::AreaInfo::numMyBases ( ) const
AreaInfo& cherrypi::AreaInfo::operator= ( AreaInfo const &  )
delete
Area * cherrypi::AreaInfo::tryGetArea ( int  id)
Area const * cherrypi::AreaInfo::tryGetArea ( int  id) const
Area * cherrypi::AreaInfo::tryGetArea ( Position  p)
Area const * cherrypi::AreaInfo::tryGetArea ( Position  p) const
void cherrypi::AreaInfo::update ( )
std::vector< Position > cherrypi::AreaInfo::walkPath ( Position  a,
Position  b,
float *  length = nullptr 
) const

Returns a path of choke points to walk from a to b.

If a or b are not accessible or a is not accessible from b, returns an empty path and sets length to infinity.

std::vector< Area const * > cherrypi::AreaInfo::walkPathAreas ( Position  a,
Position  b,
float *  length = nullptr 
) const

Returns a path of areas to walk from a to b.

If a or b are not accessible or a is not accessible from b, returns an empty path and sets length to infinity.

float cherrypi::AreaInfo::walkPathLength ( Position  a,
Position  b 
) const

Returns the distance in walktiles for a walking path a to b.


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