-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresources.h
112 lines (105 loc) · 2.47 KB
/
resources.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#pragma once
#pragma once
#include <string>
#include <vector>
#include <list>
using namespace std;
struct GameConfig//Íàñòðîéêè èãðû
{
unsigned int W;
unsigned int H;
unsigned int N;
unsigned int T;
unsigned int E_max;
unsigned int L_max;
unsigned int V_max;
unsigned int R_max;
unsigned int dL;
unsigned int dE_S;
unsigned int dE_V;
unsigned int dE_A;
unsigned int dE_P;
unsigned int dE;
unsigned int N_E;
unsigned int N_L;
float RND_min;
float RND_max;
unsigned int K;
};
struct RobotInfo //Õàðàêòåðèñòèêè ðîáîòà
{
string Name;
string Author;
unsigned int ID;
int E;
int L;
int A;
int P;
int V;
unsigned int x;
unsigned int y;
bool Alive;
unsigned int TotalScore;
unsigned int RoundScore;
unsigned int TotalFrags;
unsigned int RoundFrags;
};
#define MOVE 0
#define ATTACK 1
#define REDISTRIBUTION 2
//Âñïîìîãàòåëüíûå êëàññû
class Action
{
protected:
unsigned int type;
public:
virtual ~Action();
unsigned int getType();
};
class Move : public Action
{
public:
int dx;
int dy;
Move(int _dx, int _dy);
~Move();
};
class Attack : public Action
{
public:
unsigned int victimID;
Attack(unsigned int _victimID);
~Attack();
};
class Redistribution : public Action
{
public:
unsigned int A;
unsigned int P;
unsigned int V;
Redistribution(unsigned int _A, unsigned int _P, unsigned int _V);
~Redistribution();
};
class RobotActions
{
vector<Action*> m_Actions;
public:
RobotActions(const RobotActions& from);
RobotActions();
~RobotActions();
void addActionMove(int x, int y);
void addActionAttack(unsigned int victimID /*ID àòàêóåìîãî ðîáîòà*/);
void addActionRedistribution(unsigned int A, unsigned int P, unsigned int V);
vector<Action*> getActions();
};
struct StepInfo //ñòðóêòóðà, ïåðåäàâàåìàÿ ðîáîòó
{
vector<RobotInfo> robotsInfo; //Ñîñòîÿíèÿ âñåõ ðîáîòîâ
unsigned int stepNumber; //Íîìåð øàãà
GameConfig gameConfig; //Íàñòðîéêè èãðû
unsigned int ID; //ID ðîáîòà
list<pair<unsigned int/* x */, unsigned int/* y */>> chargingStations; //Ïóíêòû ïîäçàðÿäêè
list<pair<unsigned int/* x */, unsigned int/* y */>> maintenance; //Ïóíêòû òåõ. îáñëóæèâàíèÿ
list < pair<unsigned int/* ID */, RobotActions>> actionsList; //Ëèñò äåéñòâèé äðóãèõ ó÷àñòíèêîâ
RobotActions* pRobotActions; //Óêàçàòåëü íà êëàññ, êîòîðûé õðàíèò îòâåò ðîáîòà (åãî âûáðàííûå äåéñòâèÿ íà òåêóùåì øàãå) çàïîëíÿåòñÿ ðîáîòîì
};