-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathobject.h
76 lines (52 loc) · 1.7 KB
/
object.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
#ifndef SOLARSYSTEMOBJECT_H
#define SOLARSYSTEMOBJECT_H
#include <QObject>
#include <QString>
#include <solarsystemcore.h>
#include <memory>
namespace SolarSystem
{
// base object of solar system for storing info from database
class Object : public QObject
{
Q_OBJECT
public:
explicit Object(QObject* parent = nullptr);
~Object();
Object(const Object& obj);
Object& operator=(Object obj);
private:
struct ObjectData;
ObjectData* solarObjectData;
friend void swap(Object&, Object&);
public:
// interface
void setDescription(const QString& description);
QString description() const;
void setStringType(const QString& type);
QString stringType() const;
void setSolarObjectName(const QString& name);
QString solarObjectName() const;
void setOrbitalSpeed(float speed);
float orbitalSpeed() const;
void setMass(double mass);
double mass() const;
void setMeanRadius(float radius);
float meanRadius() const;
void setSurfaceTemperature(int temperature);
int surfaceTemperature() const;
void setSurfaceGravity(float gravity);
float surfaceGravity() const;
void setVolume(double volume);
double volume() const;
void setSolarType(ObjectType type);
ObjectType solarType() const;
void setSiderealPeriod(double period);
double siderealPeriod() const;
void setOrbitalPeriod(double period);
double orbitalPeriod() const;
};
void swap(Object& lhs, Object& rhs);
using ObjectPtr = std::shared_ptr<Object>;
}
#endif // SOLARSYSTEMOBJECT_H