-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstruct.h
125 lines (110 loc) · 2.81 KB
/
struct.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
113
114
115
116
117
118
119
120
121
122
123
124
125
/****************************************************************************
**
**
** Hex Wars - Copyright (C) 2017 Tomasz Ciborski
**
** This file is part of Hex Wars.
**
** Hex Wars is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Hex Wars is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Hex Wars. If not, see <http://www.gnu.org/licenses/>.
**
**
****************************************************************************/
/****************************************************************************
*
* struct.h
*
* structures for various assets of the game. I didn't add commentary to them,
* but it should be clear what they are supposed to mean.
*
* *************************************************************************/
#ifndef PROVINCE_H
#define PROVINCE_H
#include <QtWidgets>
//#include <QtGui>
#include "const.h"
struct City{
u_int8_t produces, timeToProduce, owner;
int pos;
};
class TransportRequest{
public:
void clear();
bool empty();
void setTarget(int Where, int To, int WaitTime, int Urgency);
int where;
int to;
int8_t waitTime;
int urgency;
};
struct TransportTask{
int pos, target;
bool mode;
};
struct BodyguardRequest{
int where;
int needed;
int urgency;
};
struct Unit{
u_int8_t type, owner, moves, HP, fuel, mode;
int gotoHex;
TransportRequest transpReq;
};
struct Hexagon{
QVector<short int> contig;
QVector<Unit> unit;
u_int8_t terrain;
short int cityId;
double height;
u_int8_t vis, discovered, visible;
short int island, region;
double gScore, fScore;
QImage texture;
};
struct Minimap{
QImage image;
int squareSize;
float pixelScale;
};
struct Player{
int level;
int citiesControl, unitsControl, unitsContType[9];
bool isHuman, isActive;
unsigned int scoreKilled, scoreProduced;
QRgb color;
QList<BodyguardRequest> bgRequest;
};
class ScanCounts{
public:
void clear();
int allyCities;
int allyTankProducers;
int allyUnits[9];
int enemyCities;
int enemyUnits[9];
int neutCities;
int unexplored;
};
struct AiCity{
int id;
int attack, danger;
int graveDanger, urgency;
int attackers, occupy;
};
struct HighScoreItem{
QString name;
u_int32_t world, turns, score;
u_int8_t size, land, diff, color;
};
#endif // PROVINCE_H