Repository navigation
Expand file tree
/
Copy pathcomputerplayer.hpp
More file actions
executable file
·69 lines (54 loc) · 1.56 KB
/
Copy pathcomputerplayer.hpp
File metadata and controls
executable file
·69 lines (54 loc) · 1.56 KB
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
68
69
#ifndef COMPUTERPLAYER_HPP
#define COMPUTERPLAYER_HPP
#include "view.hpp"
#include "main.hpp"
#include <vector>
#include <deque>
typedef unsigned int squadID;
class AIPlayer :public View
{
public:
friend class Squad;
AIPlayer(Model *model, CommandQueue *commandQueue, playerID playerId);
static std::string scout;
static std::string assault;
static std::string transport;
static std::string artillery;
static std::string helo;
static std::string nanites;
static std::string oil;
static std::string infantry;
static std::string armor;
void timepass(float dt);
void killSquad(squadID id);
void notifyNewUnit(unitID id);
void notifyDeath(unitID id);
void notifyMoveUnit(unitID id, ICoord old, ICoord current);
void notifyConversion(int scrapyard, playerID loser, playerID winner);
void notifyLowFuel(unitID id, bool empty);
struct ConstructOrder {
ConstructOrder(squadID dest, std::string type, int priority) : dest(dest), unitType(type), priority(priority) {}
squadID dest;
std::string unitType;
int priority;
};
void orderConstruction(ConstructOrder CO);
int findNearestOilWell(ICoord origin);
protected:
void assignUnits();
void processConstruction();
std::deque<ConstructOrder> pendingConstruction;
std::vector<squadID> mySquads;
//units without squads
std::set<unitID> newUnits;
//units in squads
std::set<unitID> assUnits;
//set of scrapyardIDs
std::set<int> myBases;
std::set<int> neutralBases;
std::set<int> enemyBases;
int targetScrapyard;
int findNearestScrapyard(int homeID, std::set<int> possibles);
int OilSquad;
};
#endif