forked from yanntm/YoBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnitInfoManager.h
43 lines (26 loc) · 1.11 KB
/
UnitInfoManager.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
#pragma once
#include "sc2api/sc2_api.h"
#include "UnitData.h"
#include "BaseLocation.h"
class YoAgent;
class UnitInfoManager
{
YoAgent & m_bot;
std::map<int, UnitData> m_unitData;
std::map<int, std::vector<const sc2::Unit *>> m_units;
void updateUnit(const sc2::Unit * unit);
void updateUnitInfo();
bool isValidUnit(const sc2::Unit * unit);
const UnitData & getUnitData(int player) const;
void drawSelectedUnitDebugInfo();
public:
UnitInfoManager(YoAgent & bot);
void onFrame();
void onStart();
const std::vector<const sc2::Unit *> & getUnits(int player) const;
size_t getUnitTypeCount(int player, sc2::UnitTypeID type, bool completed = true) const;
void getNearbyForce(std::vector<UnitInfo> & unitInfo, sc2::Point2D p, int player, float radius) const;
const std::map<const sc2::Unit *, UnitInfo> & getUnitInfoMap(int player) const;
//bool enemyHasCloakedUnits() const;
void drawUnitInformation(float x, float y) const;
};