-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyGlobalInfoStorer.h
67 lines (60 loc) · 1.84 KB
/
MyGlobalInfoStorer.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
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <set>
#include "model/VehicleType.h"
#include "model/VehicleUpdate.h"
#include "model/Vehicle.h"
#include <map>
#include "model/Facility.h"
#include <queue>
#include <memory>
using namespace std;
using namespace model;
using xypoint = pair<int, int>;
using dxypoint = pair<double, double>;
struct VehicleBasicInfo
{
double mX, mY;
VehicleType mType;
};
struct FacilityBasicInfo
{
double mX, mY;
FacilityType mType;
int mCapturedAt;
VehicleType mCurrentlyConstructing;
};
class MyUnitGroup;
class MyGlobalInfoStorer
{
public:
MyGlobalInfoStorer();
void processUpdates(const vector<VehicleUpdate>& vu);
void processNews(const vector<Vehicle>& startVehicleInfo, int myPlayerId);
void updateFacilities(const vector<Facility>& fs, int currentTick);
void setMyId(int id);
void buildMaps(const vector<shared_ptr<MyUnitGroup>>& groups, bool nukeComp);
double getNukeValueAtCell(int x, int y) const;
int getCellOccupLand(int x, int y) const;
int getCellOccupAir(int x, int y) const;
int getCellDangerLand(int x, int y) const;
int getCellDangerAir(int x, int y) const;
map<int, FacilityBasicInfo>& getOurFacilities();
const map<int, VehicleBasicInfo>& getOurVehicles() const;
const map<int, VehicleBasicInfo>& getEnemyVehicles() const;
const set<int>& getSelectedAllies() const;
pair<int, FacilityType> getNewFacility();
bool allyMoved(int id) const;
bool isAlly(int id) const;
const VehicleBasicInfo& getUnitInfo(int id) const;
bool anyAllyMoved() const;
int getMyId() const;
private:
int mMyId;
set<int> mSelectedAllies;
queue<pair<int, FacilityType>> mNewFacilities;
map<int, bool> mAllyMovedThisTurn;
map<int, VehicleBasicInfo> mOurVehicles, mEnemyVehicles;
map<int, FacilityBasicInfo> mOurFacilities;
vector<vector<int>> mCellOccupLand, mCellOccupAir, mCellDangerAir, mCellDangerLand;
vector<vector<double>> mNukeValue;
};