-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathArmyStrategy.h
33 lines (31 loc) · 1.07 KB
/
ArmyStrategy.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
#pragma once
#include "sc2api/sc2_interfaces.h"
#include "YoAction.h"
class CombatStrategy
{
enum CombatState {
Regrouping, // regrouping with other close by units
Attacking, // all in, go for it
Skirmishing, // do damage if not threatened/ high shields
Cornering // pursuing an enemy
};
enum CombatPolicy {
Attack,
Defend
};
CombatPolicy policy;
sc2::Units squad;
sc2::Point2D target;
sc2::Point2D rally;
std::unordered_map<sc2::Tag, CombatState> soldierStates; //what each soldier is doing
// update and cleanup workerStates, create & init states for new hires, cleanup guys that got fired
// i.e. maintenance operations on combatStates
bool updateRoster(const sc2::Units & current);
public :
void initialize(const sc2::ObservationInterface * obs, const sc2::Point2D & itarget, const sc2::Point2D & irally);
void OnStep(const sc2::ObservationInterface * obs, sc2::YoAction * actions);
void setPolicy(CombatPolicy pol, const sc2::Point2D & pos);
#ifdef DEBUG
void PrintDebug(sc2::DebugInterface * debug, const sc2::ObservationInterface * obs) const;
#endif
};