-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPlanet.h
102 lines (102 loc) · 1.82 KB
/
Planet.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
#ifndef PLANET_H
#define PLANET_H
#include <QString>
#include "Equipment.h"
#include "GoodsArr.h"
#include <array>
class Planet
{
public:
Planet(QTextStream &stream, Galaxy& galaxy, unsigned id=0, unsigned starId=0);
unsigned id() const
{
return _id;
}
bool hasMarket() const
{
return _owner!="None" && _owner!="Kling";
}
QString name() const
{
return _name;
}
const GoodsArr& goodsCount() const
{
return _goodsShopQuantity;
}
const GoodsArr& goodsSale() const
{
return _goodsSale;
}
const GoodsArr& goodsBuy() const
{
return _goodsBuy;
}
unsigned starId() const
{
return _starId;
}
unsigned size() const
{
return _size/10-5;
}
unsigned techLevel() const
{
return _techLevel;
}
unsigned techLevel(int i) const
{
return _techLevels[i];
}
QString economy() const
{
return _economy;
}
QString owner() const
{
return _owner;
}
void readTechLevels(QString &str)
{
QTextStream a(&str);
char c;
a>>_techLevels[0];
for(int i=1; i<20; i++)
{
a>>c>>_techLevels[i];
}
}
float currentInvetionPoints() const
{
return _currentInventionPoints;
}
unsigned currentInvetion() const
{
return _currentInvention;
}
QString race() const
{
return _race;
}
QString government() const
{
return _government;
}
unsigned relation() const
{
return _relation;
}
private:
QString _name, _owner, _race, _economy, _government;
unsigned _id, _size, _relation, _techLevel;
unsigned _waterSpace, _landSpace, _hillSpace;
unsigned _waterComplete, _landComplete, _hillComplete;
unsigned _orbitCount, _currentInvention;
float _currentInventionPoints;
std::unordered_set<unsigned> _eqIdList;
GoodsArr _goodsShopQuantity, _goodsSale, _goodsBuy;
std::array<unsigned,20> _techLevels;
unsigned _starId;
};
void readPlanets(QTextStream &stream, Galaxy &galaxy, unsigned starId);
#endif // PLANET_H