TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Member Functions | Public Attributes | List of all members
cherrypi::Tile Struct Reference

Represents a tile on the map. More...

#include <tilesinfo.h>

Public Member Functions

FrameNum expectsCreepBy () const
 If this tile is expected to contain creep within a certain number of frames. More...
 

Public Attributes

int x = 0
 X position of tile in walk tiles. More...
 
int y = 0
 Y position of tile in walk tiles. More...
 
bool visible = false
 
bool buildable = false
 
bool reservedAsUnbuildable = false
 Set by builderhelpers to help with planning building placement. More...
 
bool hasCreep = false
 
int lazyUpdateFrame = -kForever
 For lazily-updated info (at time of writing, just hasCreepIn): When this tile was last updated. More...
 
FrameNum expectsCreepUpdated_ = -kForever
 When this tile is expected to have creep. More...
 
FrameNum expectsCreepFrame_ = kForever
 
bool reservedForGathering = false
 Indicates that this tile is in the mineral line and that buildings should not be placed here. More...
 
bool resourceDepotUnbuildable = false
 Indicates that this tile is unbuildable for resource depots (too close to resources). More...
 
bool reservedForResourceDepot = false
 Indicates that this is a resource depot tile at an expansion, and should not be occupied by regular buildings. More...
 
FrameNum blockedUntil = 0
 Special field that can be set if a particular tile should not be used for buildings until this frame. More...
 
Unitbuilding = nullptr
 The building that is currently occupying this tile. More...
 
bool entirelyWalkable = false
 Every walk tile within this tile is walkable. More...
 
int height = 0
 
FrameNum lastSeen = 0
 
FrameNum lastSlowUpdate = 0
 

Detailed Description

Represents a tile on the map.

buildable and height are static map data, the rest are updated throughout the game. All fields might not be updated immediately every frame, but most things should only have a few frames of delay in the worst case.

Member Function Documentation

FrameNum cherrypi::Tile::expectsCreepBy ( ) const

If this tile is expected to contain creep within a certain number of frames.

Member Data Documentation

FrameNum cherrypi::Tile::blockedUntil = 0

Special field that can be set if a particular tile should not be used for buildings until this frame.

Usually set by BuilderModule when trying and, for an unknown reason, failing to build something, such that we can try to build somewhere else.

bool cherrypi::Tile::buildable = false
Unit* cherrypi::Tile::building = nullptr

The building that is currently occupying this tile.

There might be other (stacked) buildings too.

bool cherrypi::Tile::entirelyWalkable = false

Every walk tile within this tile is walkable.

This usually means that any unit can pass through this tile, ignoring buildings or other units.

FrameNum cherrypi::Tile::expectsCreepFrame_ = kForever
FrameNum cherrypi::Tile::expectsCreepUpdated_ = -kForever

When this tile is expected to have creep.

first: Last frame this was updated second: Frame creep is expected

bool cherrypi::Tile::hasCreep = false
int cherrypi::Tile::height = 0
FrameNum cherrypi::Tile::lastSeen = 0
FrameNum cherrypi::Tile::lastSlowUpdate = 0
int cherrypi::Tile::lazyUpdateFrame = -kForever

For lazily-updated info (at time of writing, just hasCreepIn): When this tile was last updated.

bool cherrypi::Tile::reservedAsUnbuildable = false

Set by builderhelpers to help with planning building placement.

bool cherrypi::Tile::reservedForGathering = false

Indicates that this tile is in the mineral line and that buildings should not be placed here.

bool cherrypi::Tile::reservedForResourceDepot = false

Indicates that this is a resource depot tile at an expansion, and should not be occupied by regular buildings.

bool cherrypi::Tile::resourceDepotUnbuildable = false

Indicates that this tile is unbuildable for resource depots (too close to resources).

bool cherrypi::Tile::visible = false
int cherrypi::Tile::x = 0

X position of tile in walk tiles.

int cherrypi::Tile::y = 0

Y position of tile in walk tiles.


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