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

A task that tracks execution of another task (for another UPCTuple). More...

#include <task.h>

Inherits cherrypi::Task.

Public Member Functions

 ProxyTask (UpcId targetUpcId, UpcId upcId)
 
virtual ~ProxyTask ()=default
 
virtual void update (State *state) override
 
virtual void cancel (State *state) override
 
virtual std::unordered_set< Unit * > const & proxiedUnits () const override
 A set of units occupied performing this task. More...
 
std::shared_ptr< Tasktarget () const
 
- 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 const char * getName () const
 A name for this task, for debugging purposes. More...
 

Protected Attributes

UpcId targetUpcId_
 
std::shared_ptr< Tasktarget_
 

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...
 

Detailed Description

A task that tracks execution of another task (for another UPCTuple).

This is a simple wrapper task that can be used for modules that are merely interested in the outcome of any action triggered by a posted UPCTuple.

Constructor & Destructor Documentation

cherrypi::ProxyTask::ProxyTask ( UpcId  targetUpcId,
UpcId  upcId 
)
virtual cherrypi::ProxyTask::~ProxyTask ( )
virtualdefault

Member Function Documentation

void cherrypi::ProxyTask::cancel ( State state)
overridevirtual

Reimplemented from cherrypi::Task.

std::unordered_set< Unit * > const & cherrypi::ProxyTask::proxiedUnits ( ) const
overridevirtual

A set of units occupied performing this task.

If this is a ProxyTask, this will reflect the units of the targeted task.

Reimplemented from cherrypi::Task.

std::shared_ptr<Task> cherrypi::ProxyTask::target ( ) const
inline
void cherrypi::ProxyTask::update ( State state)
overridevirtual

Reimplemented from cherrypi::Task.

Member Data Documentation

std::shared_ptr<Task> cherrypi::ProxyTask::target_
protected
UpcId cherrypi::ProxyTask::targetUpcId_
protected

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