blob: dc56033ae1228f6551aff7d4048b1b997e1c01c3 (
plain)
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
103
|
/*
base/shipmodel.h
This file is part of the Osirion project and is distributed under
the terms and conditions of the GNU General Public License version 2
*/
#ifndef __INCLUDED_BASE_SHIPMODEL_H__
#define __INCLUDED_BASE_SHIPMODEL_H__
#include <string>
#include "core/info.h"
namespace game
{
/// ship model specification
class ShipModel : public core::Info
{
public:
/// default constructor
ShipModel();
/// default destructor
virtual ~ShipModel();
/* ---- inspectors ------------------------------------------------ */
/// indicates if this model can be equiped with a jump drive
inline const bool jumpdrive() const {
return shipmodel_jumpdrive;
}
/// acceleration
inline const float acceleration() const {
return shipmodel_acceleration;
}
/// maximum speed
inline const float maxspeed() const {
return shipmodel_maxspeed;
}
/// turn speed in rotations per second
inline const float turnspeed() const {
return shipmodel_turnspeed;
}
/// size of the cargo hold
inline const float maxcargo() const {
return shipmodel_maxcargo;
}
/* ---- mutators -------------------------------------------------- */
/// set acceleration
inline void set_acceleration(const float acceleration) {
shipmodel_acceleration = acceleration;
}
/// set maximum speed
inline void set_maxspeed(const float maxspeed) {
shipmodel_maxspeed = maxspeed;
}
/// set turn speed
inline void set_turnspeed(const float turnspeed) {
shipmodel_turnspeed = turnspeed;
}
/// set size of the cargo hold
inline void set_maxcargo(const float maxcargo) {
shipmodel_maxcargo = maxcargo;
}
/// set jumpdrive capability
inline void set_jumpdrive(const bool jumpdrive) {
shipmodel_jumpdrive = jumpdrive;
}
void generate_info();
/* --- static registry functions ---------------------------------- */
static ShipModel *find(const std::string & label);
static ShipModel *search(const std::string searchstr);
static core::InfoType *shipmodel_infotype;
private:
bool shipmodel_jumpdrive;
float shipmodel_acceleration;
float shipmodel_maxspeed;
float shipmodel_turnspeed;
float shipmodel_maxcargo;
};
}
#endif // __INCLUDED_BASE_SHIPMODEL_H__
|