-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEquipment.h
73 lines (65 loc) · 1.97 KB
/
Equipment.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
#ifndef EQUIPMENT_H
#define EQUIPMENT_H
#include <QString>
#include <QTextStream>
#include <QMap>
#include <QVector>
#include <unordered_set>
#include <unordered_map>
//#include <initializer_list>
class Galaxy;
class Equipment
{
public:
enum LocationType {kShipEq, kShipStorage, kShipShop, kJunk, kPlanetShop, kPlanetStorage, kPlanetTreasure};
Equipment(QTextStream &stream, Galaxy &galaxy, LocationType locationType, unsigned locationId, unsigned id=0);
unsigned id() const
{
return _id;
}
QString locationTypeString() const;
LocationType locationType() const
{
return _locationType;
}
unsigned locationId() const
{
return _locationId;
}
QString name() const
{
return _name;
}
QString extra(const QString& key) const
{
return extraFields.value(key,"none");
}
unsigned size() const;
unsigned cost() const;
unsigned techLevel() const;
double durability() const;
QString type() const;
QString owner() const;
QString bonusNote() const;
private:
QString _name;
QString _type;
QString _owner;
unsigned _id;
unsigned _size;
unsigned _cost;
double _durability;
unsigned _techLevel;
LocationType _locationType;
unsigned _locationId;
QMap<QString,QString> extraFields;
QString _specialName;
//static const QMap<unsigned,QString> specialCodes;
static QMap<QString,QString> loadDescriptions(const QString& filename);
static const QMap<QString,QString> specialTypesDescriptions;//type_name:lvl, description
static const QMap<QString,QString> specialHullsDescriptions;//type_name:lvl, description
static const QMap<QString,QString> artifactsDescriptions;//type,description
static const QMap<QString,QString> micromodulesDescriptions;//name,description
};
std::unordered_set<unsigned> readEqlist(QTextStream &stream, Galaxy &galaxy, Equipment::LocationType locationType, unsigned locationId);
#endif // EQUIPMENT_H