forked from yanntm/YoBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WorkerManager.h
48 lines (35 loc) · 1.41 KB
/
WorkerManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include "WorkerData.h"
class Building;
class YoAgent;
class WorkerManager
{
YoAgent & m_bot;
mutable WorkerData m_workerData;
const sc2::Unit * m_previousClosestWorker;
void setMineralWorker(const sc2::Unit * unit);
void handleIdleWorkers();
void handleGasWorkers();
void handleRepairWorkers();
public:
WorkerManager(YoAgent & bot);
void onStart();
void onFrame();
void finishedWithWorker(const sc2::Unit * unit);
void drawResourceDebugInfo();
void drawWorkerInformation();
void setScoutWorker(const sc2::Unit * worker);
void setCombatWorker(const sc2::Unit * worker);
void setBuildingWorker(const sc2::Unit * worker, Building & b);
void setRepairWorker(const sc2::Unit * worker, const sc2::Unit * unitToRepair);
void stopRepairing(const sc2::Unit * worker);
int getNumMineralWorkers();
int getNumGasWorkers();
bool isWorkerScout(const sc2::Unit * worker) const;
bool isFree(const sc2::Unit * worker) const;
bool isBuilder(const sc2::Unit * worker) const;
const sc2::Unit * getBuilder(Building & b, bool setJobAsBuilder = true) const;
const sc2::Unit * getClosestDepot(const sc2::Unit * worker) const;
const sc2::Unit * getGasWorker(const sc2::Unit * refinery) const;
const sc2::Unit * getClosestMineralWorkerTo(const sc2::Point2D & pos) const;
};