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

Manages and updates per-tile data. More...

#include <tilesinfo.h>

Classes

struct  TileOccupyingBuilding
 

Public Member Functions

 TilesInfo (State *state_)
 
 TilesInfo (TilesInfo const &)=delete
 
TilesInfooperator= (TilesInfo const &)=delete
 
void preUnitsUpdate ()
 
void postUnitsUpdate ()
 
unsigned mapTileWidth () const
 
unsigned mapTileHeight () const
 
TilegetTile (int walkX, int walkY)
 
const TilegetTile (int walkX, int walkY) const
 
TiletryGetTile (int walkX, int walkY)
 
const TiletryGetTile (int walkX, int walkY) const
 
void reserveArea (const BuildType *type, int walkX, int walkY)
 This sets reservedAsUnbuildable in the tiles that would be occupied by the specified building at the specified build location (upper left corner coordinates). More...
 
void unreserveArea (const BuildType *type, int walkX, int walkY)
 

Public Attributes

std::vector< Tiletiles
 All the tiles. More...
 

Static Public Attributes

static const unsigned tilesWidth = 256
 
static const unsigned tilesHeight = 256
 

Protected Attributes

unsigned mapTileWidth_ = 0
 
unsigned mapTileHeight_ = 0
 
std::unordered_map< const Unit *, TileOccupyingBuildingtileOccupyingBuildings_
 
Statestate_ = nullptr
 
FrameNum lastSlowTileUpdate_ = 0
 
FrameNum lastUpdateBuildings_ = 0
 
FrameNum lastFowCreepUpdate_ = 0
 

Detailed Description

Manages and updates per-tile data.

Constructor & Destructor Documentation

cherrypi::TilesInfo::TilesInfo ( State state_)
cherrypi::TilesInfo::TilesInfo ( TilesInfo const &  )
delete

Member Function Documentation

Tile & cherrypi::TilesInfo::getTile ( int  walkX,
int  walkY 
)
const Tile & cherrypi::TilesInfo::getTile ( int  walkX,
int  walkY 
) const
unsigned cherrypi::TilesInfo::mapTileHeight ( ) const
inline
unsigned cherrypi::TilesInfo::mapTileWidth ( ) const
inline
TilesInfo& cherrypi::TilesInfo::operator= ( TilesInfo const &  )
delete
void cherrypi::TilesInfo::postUnitsUpdate ( )
void cherrypi::TilesInfo::preUnitsUpdate ( )
void cherrypi::TilesInfo::reserveArea ( const BuildType type,
int  walkX,
int  walkY 
)

This sets reservedAsUnbuildable in the tiles that would be occupied by the specified building at the specified build location (upper left corner coordinates).

Should only be used by BuilderModule.

Tile * cherrypi::TilesInfo::tryGetTile ( int  walkX,
int  walkY 
)
const Tile * cherrypi::TilesInfo::tryGetTile ( int  walkX,
int  walkY 
) const
void cherrypi::TilesInfo::unreserveArea ( const BuildType type,
int  walkX,
int  walkY 
)

Member Data Documentation

FrameNum cherrypi::TilesInfo::lastFowCreepUpdate_ = 0
protected
FrameNum cherrypi::TilesInfo::lastSlowTileUpdate_ = 0
protected
FrameNum cherrypi::TilesInfo::lastUpdateBuildings_ = 0
protected
unsigned cherrypi::TilesInfo::mapTileHeight_ = 0
protected
unsigned cherrypi::TilesInfo::mapTileWidth_ = 0
protected
State* cherrypi::TilesInfo::state_ = nullptr
protected
std::unordered_map<const Unit*, TileOccupyingBuilding> cherrypi::TilesInfo::tileOccupyingBuildings_
protected
std::vector<Tile> cherrypi::TilesInfo::tiles

All the tiles.

Prefer to use getTile, this is only here in case it is needed for performance.

const unsigned cherrypi::TilesInfo::tilesHeight = 256
static
const unsigned cherrypi::TilesInfo::tilesWidth = 256
static

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