10 #include "modules/gatherer/resourceworkers.h" 37 std::unordered_map<Unit*, WorkerState>
workers;
Game state.
Definition: state.h:42
int cooldownUntil
Next frame we're allowed to reassign this worker to a new resource.
Definition: gathererassignments.h:26
void step(State *)
Update gathering assignments for this frame.
Definition: gathererassignments.cpp:118
Data structure for storing the state of our gathering assignments.
Definition: resourceworkers.h:24
double lastResourceScore
Tracks the gathering value of this worker's last resource.
Definition: gathererassignments.h:30
Assigns workers to resources for optimal gathering.
Definition: gathererassignments.h:18
std::unordered_map< Unit *, WorkerState > workers
Mapping of workers to their gathering state.
Definition: gathererassignments.h:37
Used internally to track worker statefulness.
Definition: gathererassignments.h:20
Represents a unit in the game.
Definition: unitsinfo.h:35
ResourceWorkers resourceWorkers
Mapping of workers assigned to resources.
Definition: gathererassignments.h:34
void addUnit(Unit *)
Include a worker in gathering.
Definition: gathererassignments.cpp:91
void removeUnit(Unit *)
Remove a worker from gathering.
Definition: gathererassignments.cpp:95
int framesSinceUpdate
Number of frames since this worker has had a gathering update.
Definition: gathererassignments.h:22
int constexpr kForever
Definition: basetypes.h:37
Main namespace for bot-related code.
Definition: areainfo.cpp:17