-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathShip.h
75 lines (70 loc) · 1.51 KB
/
Ship.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
#ifndef SHIP_H
#define SHIP_H
#include "GoodsArr.h"
#include <QString>
#include <QTextStream>
#include <unordered_set>
#include <unordered_map>
class Galaxy;
class Ship
{
public:
Ship(QTextStream &stream, Galaxy& galaxy, unsigned id, unsigned starId);
unsigned id() const
{
return _id;
}
bool hasMarket() const
{
return !(_goodsSale.empty());
}
QString name() const
{
return _fullName;
}
const GoodsArr& goodsCount() const
{
return _goodsShopQuantity;
}
const GoodsArr& goodsSale() const
{
return _goodsSale;
}
const GoodsArr& goodsBuy() const
{
return _goodsBuy;
}
unsigned starId() const
{
return _starId;
}
QString race() const
{
if (_type=="Kling") {
return _skin.split('.')[1];
}
if (_type!="Pirate") {
return "Normal";
}
return _type;
}
private:
void compactifyName();
private:
unsigned _id;
QString _type;
QString _fullName;
QString _skin;
GoodsArr _goodsQuantity;
GoodsArr _goodsShopQuantity, _goodsSale, _goodsBuy;
unsigned _relation;
unsigned _money;
std::unordered_set<unsigned> _eqIdList;
//QString _place;
//unsigned _placeId;
unsigned _starId;
unsigned _special;
//enum Akrin { kNone, kMyoplasmic, kPygamore, kTranscendental, kUpgraded, kBiogenic, kNanobrolite, kUltraalloy, kHybrid};
};
void readShiplist(QTextStream &stream, Galaxy &galaxy, unsigned starId);
#endif // SHIP_H