52 explicit Task(
UpcId upcId, std::unordered_set<Unit*> units = {})
53 : upcId_(upcId), units_(std::move(units)) {}
74 virtual void cancel(
State*);
94 std::unordered_set<Unit*>
const&
units()
const {
110 std::unordered_set<Unit*>&
units() {
115 virtual void removeDeadOrReassignedUnits(
State* state);
120 std::unordered_set<Unit*> units_;
134 virtual void update(
State* state)
override;
135 virtual void cancel(
State* state)
override;
136 virtual std::unordered_set<Unit*>
const& proxiedUnits()
const override;
180 virtual void update(
State* state)
override;
181 virtual void cancel(
State* state)
override;
182 virtual std::unordered_set<Unit*>
const& proxiedUnits()
const override;
184 std::vector<std::shared_ptr<Task>>
targets()
const {
Game state.
Definition: state.h:42
virtual std::unordered_set< Unit * > const & proxiedUnits() const
A set of units occupied performing this task.
Definition: task.h:100
Most tasks (i.e. more than half) have a given status.
UpcId upcId() const
UPC id in Blackboard that caused this Task to be spawned.
Definition: task.h:90
std::unordered_set< Unit * > const & units() const
A set of units occupied performing this task.
Definition: task.h:94
One task has a given status.
The primary way for modules to publish their activity.
Definition: task.h:50
Task is currently ongoing.
std::unordered_set< Unit * > & units()
Definition: task.h:110
Task(UpcId upcId, std::unordered_set< Unit * > units={})
Definition: task.h:52
replayer::Unit Unit
Definition: state.h:36
bool finished() const
Definition: task.h:84
All tasks have a given status.
std::shared_ptr< Task > target_
Definition: task.h:144
A task that tracks execution of multiple other tasks.
Definition: task.h:173
Represents a unit in the game.
Definition: unitsinfo.h:35
std::vector< std::shared_ptr< Task > > targets_
Definition: task.h:192
UpcId targetUpcId_
Definition: task.h:143
Task finished successfully.
TaskStatus status() const
Definition: task.h:76
TaskStatus
Describes the current status of a task.
Definition: task.h:23
std::map< TaskStatus, ProxyPolicy > policy_
Definition: task.h:194
A task that tracks execution of another task (for another UPCTuple).
Definition: task.h:129
ProxyPolicy
Policies for tracking multiple tasks.
Definition: task.h:148
virtual const char * getName() const
A name for this task, for debugging purposes.
Definition: task.h:105
std::vector< UpcId > targetUpcIds_
Definition: task.h:191
std::unordered_set< Unit * > proxiedUnits_
Definition: task.h:193
Task failed or was aborted.
Main namespace for bot-related code.
Definition: areainfo.cpp:17
std::shared_ptr< Task > target() const
Definition: task.h:138
void removeUnit(BuildState &st, BuildStateUnit &u)
Definition: autobuild.cpp:182
int UpcId
Definition: basetypes.h:23
virtual ~Task()
Definition: task.h:54
void setStatus(TaskStatus status)
Definition: task.h:80
virtual void update(State *)
Definition: task.h:56
std::vector< std::shared_ptr< Task > > targets() const
Definition: task.h:184