BWAPI
Public Member Functions | Static Public Member Functions | Static Public Attributes
Task Class Reference

#include <Builder.h>

Inheritance diagram for Task:
Inheritance graph
[legend]
Collaboration diagram for Task:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Task (BWAPI::Unit *w, BWAPI::TilePosition tp=BWAPI::TilePositions::None, BWAPI::UnitType ut=BWAPI::UnitTypes::None, int lo=0)
void init ()
 ~Task ()
virtual void onOffer (std::set< BWAPI::Unit * > units)
virtual void onRevoke (BWAPI::Unit *unit, double bid)
void askWorker ()
void buildIt ()
virtual std::string getName () const
virtual std::string getShortName () const
void check ()
virtual void update ()
const BWAPI::UnitType & getType () const
int getLastOrder () const
bool isFinished ()
 Task ()
 Task (const BWAPI::UnitType t, const BWAPI::TilePosition p=BWAPI::TilePositions::None)
 Task (const BWAPI::TechType t, const BWAPI::TilePosition p=BWAPI::TilePositions::None)
 Task (const BWAPI::UpgradeType t, int l=-1, const BWAPI::TilePosition p=BWAPI::TilePositions::None)
Taskoperator= (const Task t)
TasksetType (const BWAPI::UnitType t, const BWAPI::TilePosition p=BWAPI::TilePositions::None)
TasksetType (const BWAPI::TechType t, const BWAPI::TilePosition p=BWAPI::TilePositions::None)
TasksetType (const BWAPI::UpgradeType t, int l=-1, const BWAPI::TilePosition p=BWAPI::TilePositions::None)
TasksetLevel (int l)
TasksetTilePosition (const BWAPI::TilePosition p)
bool operator== (void *ptr) const
bool operator!= (void *ptr) const
bool operator== (const Task &t) const
bool operator< (const Task &t) const
bool operator== (const BWAPI::UnitType &t) const
bool operator== (const BWAPI::TechType &t) const
bool operator== (const BWAPI::UpgradeType &t) const
bool operator== (const BWAPI::TilePosition &p) const
bool isBeingExecutedBy (const BWAPI::Unit *unit) const
TaskTypes::Enum getType () const
BWAPI::UnitType getUnit () const
BWAPI::TechType getTech () const
BWAPI::UpgradeType getUpgrade () const
int getLevel () const
BWAPI::TilePosition getTilePosition () const
BWAPI::UnitType getWorkerType () const
BWAPI::Race getRace () const
std::map< BWAPI::UnitType, int > getRequiredUnits () const
Resources getResources () const
int getTime () const
std::string getName () const
std::string getVerb () const
void setEarliestStartTime (int time)
int getEarliestStartTime () const
void setStartTime (int time)
int getStartTime () const
int getFinishTime () const
int getRemainingTime () const
void setSpentResources (bool spent)
bool hasSpentResources () const
void setExecuting (bool exec)
bool isExecuting () const
void setReservedResourcesThisFrame (bool reserved)
bool hasReservedResourcesThisFrame () const
void setReservedFinishDataThisFrame (bool reserved)
bool hasReservedFinishDataThisFrame () const
void setCompleted (bool c)
bool isCompleted () const

Static Public Member Functions

static int framesToCompleteRequirements (BWAPI::UnitType type)

Static Public Attributes

static SimCityBuildingPlacerbuildingPlacer = NULL

Constructor & Destructor Documentation

Task::Task ( BWAPI::Unit *  w,
BWAPI::TilePosition  tp = BWAPI::TilePositions::None,
BWAPI::UnitType  ut = BWAPI::UnitTypes::None,
int  lo = 0 
)

Here is the call graph for this function:

Task::Task ( const BWAPI::UnitType  t,
const BWAPI::TilePosition  p = BWAPI::TilePositions::None 
)
Task::Task ( const BWAPI::TechType  t,
const BWAPI::TilePosition  p = BWAPI::TilePositions::None 
)
Task::Task ( const BWAPI::UpgradeType  t,
int  l = -1,
const BWAPI::TilePosition  p = BWAPI::TilePositions::None 
)

Member Function Documentation

void Task::askWorker ( ) [inline]

Here is the call graph for this function:

Here is the caller graph for this function:

void Task::buildIt ( ) [inline]

Just in case the worker got killed / captured

If it requires psi but there is not, ask for a powering pylon, or cancel if we can't power it

Ask for a powering pylon

Move closer to the construction site

Try and build it if we can

Here is the call graph for this function:

Here is the caller graph for this function:

void Task::check ( )

Check if we have finished, or if there are blocking units we can move, or if the build TilePosition is really blocked

Retry in a few seconds because the fucker stole our gas

Here is the call graph for this function:

int Task::framesToCompleteRequirements ( BWAPI::UnitType  type) [static]

We don't have the requirements we will have to delay this construction

We are not building the requirement, get it into the production line

We are building this requirement, how much time before completion?

Here is the call graph for this function:

Here is the caller graph for this function:

int Task::getFinishTime ( ) const

finish time = start time + getTime(), note: not accurate for halted constructions

int Task::getLastOrder ( ) const
int Task::getLevel ( ) const

Level (if upgrade)

std::string Task::getName ( ) const [virtual]

Implements Arbitrator::Controller< BWAPI::Unit *, double >.

Here is the caller graph for this function:

std::string Task::getName ( ) const [virtual]
BWAPI::Race Task::getRace ( ) const

Race of the worker type

int Task::getRemainingTime ( ) const

Remaining time until this task is complete

std::map< BWAPI::UnitType, int > Task::getRequiredUnits ( ) const

requiredUnits, whatResearches, or whatUpgrades

string Task::getShortName ( ) const [virtual]

Reimplemented from Arbitrator::Controller< BWAPI::Unit *, double >.

Here is the call graph for this function:

int Task::getStartTime ( ) const
BWAPI::TechType Task::getTech ( ) const

Returns the TechType if Task is a tech, or TechTypes::None

BWAPI::TilePosition Task::getTilePosition ( ) const

Tile Position (if building/add-on)

int Task::getTime ( ) const
BWAPI::UnitType Task::getUnit ( ) const

Returns UnitType if Task is a unit, or UnitTypes::None

BWAPI::UpgradeType Task::getUpgrade ( ) const

Returns the UpgradeType if Task is an upgrade, or UpgradeTypes::None

std::string Task::getVerb ( ) const

Build, Research, Upgrade

BWAPI::UnitType Task::getWorkerType ( ) const

whatBuilds, whatResearches, or whatUpgrades

bool Task::hasSpentResources ( ) const
void Task::init ( )

Here is the call graph for this function:

Here is the caller graph for this function:

bool Task::isBeingExecutedBy ( const BWAPI::Unit *  unit) const

Here is the call graph for this function:

bool Task::isCompleted ( ) const

Here is the caller graph for this function:

bool Task::isExecuting ( ) const
bool Task::isFinished ( )
void Task::onOffer ( std::set< BWAPI::Unit * >  units) [virtual]

Implements Arbitrator::Controller< BWAPI::Unit *, double >.

Here is the call graph for this function:

void Task::onRevoke ( BWAPI::Unit *  unit,
double  bid 
) [virtual]

Implements Arbitrator::Controller< BWAPI::Unit *, double >.

Here is the call graph for this function:

bool Task::operator!= ( void *  ptr) const
bool Task::operator< ( const Task t) const
Task & Task::operator= ( const Task  t)
bool Task::operator== ( void *  ptr) const
bool Task::operator== ( const Task t) const
bool Task::operator== ( const BWAPI::UnitType &  t) const
bool Task::operator== ( const BWAPI::TechType &  t) const
bool Task::operator== ( const BWAPI::UpgradeType &  t) const
bool Task::operator== ( const BWAPI::TilePosition &  p) const
void Task::setCompleted ( bool  c)
void Task::setEarliestStartTime ( int  time)

set/get the earliest start time for this task

void Task::setExecuting ( bool  exec)
Task & Task::setLevel ( int  l)
void Task::setReservedFinishDataThisFrame ( bool  reserved)
void Task::setReservedResourcesThisFrame ( bool  reserved)
void Task::setSpentResources ( bool  spent)
void Task::setStartTime ( int  time)

set/get the actual start time for this task

Task & Task::setTilePosition ( const BWAPI::TilePosition  p)
Task & Task::setType ( const BWAPI::UnitType  t,
const BWAPI::TilePosition  p = BWAPI::TilePositions::None 
)
Task & Task::setType ( const BWAPI::TechType  t,
const BWAPI::TilePosition  p = BWAPI::TilePositions::None 
)
Task & Task::setType ( const BWAPI::UpgradeType  t,
int  l = -1,
const BWAPI::TilePosition  p = BWAPI::TilePositions::None 
)
void Task::update ( ) [virtual]

Implements Arbitrator::Controller< BWAPI::Unit *, double >.

Here is the call graph for this function:


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines