BWAPI
|
#include <Builder.h>
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) | |
Task & | operator= (const Task t) |
Task & | setType (const BWAPI::UnitType t, const BWAPI::TilePosition p=BWAPI::TilePositions::None) |
Task & | setType (const BWAPI::TechType t, const BWAPI::TilePosition p=BWAPI::TilePositions::None) |
Task & | setType (const BWAPI::UpgradeType t, int l=-1, const BWAPI::TilePosition p=BWAPI::TilePositions::None) |
Task & | setLevel (int l) |
Task & | setTilePosition (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 SimCityBuildingPlacer * | buildingPlacer = NULL |
Task::Task | ( | BWAPI::Unit * | w, |
BWAPI::TilePosition | tp = BWAPI::TilePositions::None , |
||
BWAPI::UnitType | ut = BWAPI::UnitTypes::None , |
||
int | lo = 0 |
||
) |
Task::~Task | ( | ) |
Task::Task | ( | ) |
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 |
||
) |
void Task::askWorker | ( | ) | [inline] |
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
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
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?
int Task::getEarliestStartTime | ( | ) | const |
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 >.
std::string Task::getName | ( | ) | const [virtual] |
Implements Arbitrator::Controller< BWAPI::Unit *, double >.
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
Resources Task::getResources | ( | ) | const |
string Task::getShortName | ( | ) | const [virtual] |
Reimplemented from Arbitrator::Controller< BWAPI::Unit *, double >.
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 |
TaskTypes::Enum Task::getType | ( | ) | const |
TaskTypes::Enum Task::getType | ( | ) | 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::hasReservedFinishDataThisFrame | ( | ) | const |
bool Task::hasReservedResourcesThisFrame | ( | ) | const |
bool Task::hasSpentResources | ( | ) | const |
void Task::init | ( | ) |
bool Task::isBeingExecutedBy | ( | const BWAPI::Unit * | unit | ) | const |
bool Task::isCompleted | ( | ) | const |
bool Task::isExecuting | ( | ) | const |
bool Task::isFinished | ( | ) |
void Task::onOffer | ( | std::set< BWAPI::Unit * > | units | ) | [virtual] |
Implements Arbitrator::Controller< BWAPI::Unit *, double >.
void Task::onRevoke | ( | BWAPI::Unit * | unit, |
double | bid | ||
) | [virtual] |
Implements Arbitrator::Controller< BWAPI::Unit *, double >.
bool Task::operator!= | ( | void * | ptr | ) | const |
bool Task::operator< | ( | const Task & | t | ) | const |
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 >.
SimCityBuildingPlacer * Task::buildingPlacer = NULL [static] |