-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharacteristic.h
54 lines (46 loc) · 2.09 KB
/
characteristic.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
#ifndef CHARACTERISTIC_H
#define CHARACTERISTIC_H
#include "shared.h"
#include <QJsonObject>
#include <QObject>
class Characteristic
{
public:
Characteristic()
: _base(0), _cost(0_cp), _init(0), _per(0), _primary(0), _secondary(0), _maxima(0) { }
Characteristic(int base, Points cost, int maxima, int per = 1, int init = 0, int primary = 0, int secondary = 0)
: _base(base), _cost(cost), _init(init == 0 ? base : init), _per(per), _primary(primary), _secondary(secondary), _maxima(maxima) { }
Characteristic(const Characteristic& c): Characteristic(c._base, c._cost, c._maxima, c._per, c._init, c._primary, c._secondary) { }
Characteristic(Characteristic&& c): Characteristic(c._base, c._cost, c._maxima, c._per, c._init, c._primary, c._secondary) { }
Characteristic(const QJsonObject& c);
~Characteristic() { }
Characteristic& operator=(const Characteristic& c);
Characteristic& operator=(Characteristic&& c);
int base() { return _base; }
Characteristic& base(int n) { _base = n; return *this; }
Points cost() { return _cost; }
Characteristic& cost(Points n) { _cost = n; return *this; }
int init() { return _init; }
Characteristic& init(int n) { _init = n; return *this; }
int maxima() { return _maxima; }
Characteristic& maxima(int n) { _maxima = n; return *this; }
int per() { return _per; }
Characteristic& per(int n) { _per = n; return *this; }
int primary() { return _primary; }
Characteristic& primary(int n) { _primary = n; return *this; }
int secondary() { return _secondary; }
Characteristic& secondary(int n) { _secondary = n; return *this; }
Points points();
QString roll();
QJsonObject toJson();
QString value();
private:
int _base = 0;
Points _cost = 0_cp;
int _init = 0;
int _per = 0;
int _primary = 0;
int _secondary = 0;
int _maxima = 0;
};
#endif // CHARACTERISTIC_H