-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathCombatCommander.h
42 lines (28 loc) · 1.07 KB
/
CombatCommander.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
#pragma once
#include "Common.h"
#include "Squad.h"
#include "SquadData.h"
class CCBot;
class CombatCommander
{
CCBot & m_bot;
SquadData m_squadData;
std::vector<Unit> m_combatUnits;
bool m_initialized;
bool m_attackStarted;
void updateScoutDefenseSquad();
void updateDefenseSquads();
void updateAttackSquads();
void updateIdleSquad();
bool isSquadUpdateFrame();
Unit findClosestDefender(const Squad & defenseSquad, const CCPosition & pos);
Unit findClosestWorkerTo(std::vector<Unit> & unitsToAssign, const CCPosition & target);
CCPosition getMainAttackLocation();
void updateDefenseSquadUnits(Squad & defenseSquad, const size_t & flyingDefendersNeeded, const size_t & groundDefendersNeeded);
bool shouldWeStartAttacking();
public:
CombatCommander(CCBot & bot);
void onStart();
void onFrame(const std::vector<Unit> & combatUnits);
void drawSquadInformation();
};