10 #include "unitsinfo.h" std::unordered_map< Unit *, std::unordered_set< Unit * > > workersByResource
Definition: resourceworkers.h:49
bool containsResource(Unit *resource)
Is this resource currently included in gathering?
Definition: resourceworkers.cpp:48
Data structure for storing the state of our gathering assignments.
Definition: resourceworkers.h:24
bool excludeResource(Unit *resource)
Disallow gathering from a resource.
Definition: resourceworkers.cpp:53
size_t size()
For how many resources is gathering enabled?
Definition: resourceworkers.h:43
Represents a unit in the game.
Definition: unitsinfo.h:35
std::unordered_map< Unit *, Unit * > resourceByWorker
Definition: resourceworkers.h:48
auto end()
End iterator for worker assignments; allows treatment as a C++ Range.
Definition: resourceworkers.h:39
Unit * getResource(Unit *worker) const
To which resource (if any) is this worker assigned?
Definition: resourceworkers.cpp:66
void unassignWorker(Unit *worker)
Remove a worker from gathering and any resources it might be assigned to.
Definition: resourceworkers.cpp:30
size_t countWorkers(Unit *resource) const
How many workers are assigned to this resource?
Definition: resourceworkers.cpp:72
Main namespace for bot-related code.
Definition: areainfo.cpp:17
void assignWorker(Unit *worker, Unit *resource)
Assign a worker to gathering a specific resource.
Definition: resourceworkers.cpp:16
void includeResource(Unit *resource)
Allow gathering from a resource.
Definition: resourceworkers.cpp:41
auto begin()
Start iterator for worker assignments; allows treatment as a C++ Range.
Definition: resourceworkers.h:35