forked from yanntm/YoBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseLocation.h
57 lines (42 loc) · 1.59 KB
/
BaseLocation.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
48
49
50
51
52
53
54
55
56
57
#pragma once
#include <map>
#include <vector>
#include "sc2api/sc2_api.h"
#include "DistanceMap.h"
class YoAgent;
class BaseLocation
{
YoAgent & m_bot;
DistanceMap m_distanceMap;
public:
sc2::Point2D m_depotPosition;
sc2::Point2D m_centerOfResources;
std::vector<const sc2::Unit *> m_geysers;
std::vector<const sc2::Unit *> m_minerals;
std::vector<sc2::Point2D> m_mineralPositions;
std::vector<sc2::Point2D> m_geyserPositions;
std::map<int, bool> m_isPlayerOccupying;
std::map<int, bool> m_isPlayerStartLocation;
int m_baseID;
float m_left;
float m_right;
float m_top;
float m_bottom;
bool m_isStartLocation;
BaseLocation(YoAgent & bot, int baseID, const std::vector<const sc2::Unit *> & resources);
int getGroundDistance(const sc2::Point2D & pos) const;
bool isStartLocation() const;
bool isPlayerStartLocation(int player) const;
bool isMineralOnly() const;
bool containsPosition(const sc2::Point2D & pos) const;
const sc2::Point2D & getDepotPosition() const;
const sc2::Point2D & getPosition() const;
const std::vector<const sc2::Unit *> & getGeysers() const;
const std::vector<const sc2::Unit *> & getMinerals() const;
bool isOccupiedByPlayer(int player) const;
bool isExplored() const;
bool isInResourceBox(int x, int y) const;
void setPlayerOccupying(int player, bool occupying);
const std::vector<sc2::Point2D> & getClosestTiles() const;
void draw();
};