TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
Generic Task for Controller. More...
#include <controller.h>
Inherits cherrypi::Task.
Public Member Functions | |
ControllerTask (UpcId upcId, std::unordered_set< Unit * > units, State *state, std::shared_ptr< Controller > controller) | |
virtual | ~ControllerTask ()=default |
virtual void | update (State *state) override |
virtual void | cancel (State *state) override |
std::shared_ptr< Controller > | controller () const |
virtual const char * | getName () const override |
A name for this task, for debugging purposes. More... | |
Public Member Functions inherited from cherrypi::Task | |
Task (UpcId upcId, std::unordered_set< Unit * > units={}) | |
virtual | ~Task () |
TaskStatus | status () const |
void | setStatus (TaskStatus status) |
bool | finished () const |
UpcId | upcId () const |
UPC id in Blackboard that caused this Task to be spawned. More... | |
std::unordered_set< Unit * > const & | units () const |
A set of units occupied performing this task. More... | |
void | removeUnit (Unit *unit) |
virtual std::unordered_set< Unit * > const & | proxiedUnits () const |
A set of units occupied performing this task. More... | |
Protected Attributes | |
std::shared_ptr< Controller > | controller_ |
Additional Inherited Members | |
Protected Member Functions inherited from cherrypi::Task | |
std::unordered_set< Unit * > & | units () |
virtual void | removeDeadOrReassignedUnits (State *state) |
Remove units that have been assigned to another task and units that have died. More... | |
Generic Task for Controller.
Please see Controller for further details and a usage example.
cherrypi::ControllerTask::ControllerTask | ( | UpcId | upcId, |
std::unordered_set< Unit * > | units, | ||
State * | state, | ||
std::shared_ptr< Controller > | controller | ||
) |
|
virtualdefault |
|
overridevirtual |
Reimplemented from cherrypi::Task.
std::shared_ptr< Controller > cherrypi::ControllerTask::controller | ( | ) | const |
|
inlineoverridevirtual |
A name for this task, for debugging purposes.
Reimplemented from cherrypi::Task.
|
overridevirtual |
Reimplemented from cherrypi::Task.
|
protected |