Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: 686d7361f896f22426923e65f077b208789655b4 (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
/*
   game/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_GAME_SHIPMODEL_H__
#define __INCLUDED_GAME_SHIPMODEL_H__

#include <map>
#include <string>

namespace game {

/// ship model specifications
class ShipModel
{
public:
	ShipModel();
	~ShipModel();

	/// acceleration
	inline float acceleration() const { return shipmodel_acceleration; }

	/// maximum speed
	inline float maxspeed() const { return shipmodel_maxspeed; }
	
	/// turn speed in rotations per second
	inline float turnspeed() const { return shipmodel_turnspeed; }

	/// label of the ship model
	inline std::string const &label() const { return shipmodel_label; }

	/// name of the ship model
	inline std::string const & name() const { return shipmodel_name; }

	/// name of the model of the ship
	inline std::string const & modelname() const { return shipmodel_modelname; }

	float 			shipmodel_acceleration;
	float 			shipmodel_maxspeed;
	float 			shipmodel_turnspeed;
	std::string 		shipmodel_label;
	std::string 		shipmodel_name;
	std::string 		shipmodel_modelname;

	static ShipModel *find(const std::string label);

	/// the ship model registry
	static std::map<std::string, ShipModel *>	registry;

	typedef std::map<std::string, ShipModel *>::iterator iterator;

	/// clear the ship model registry
	static void clear();

	/// list the ship model registry
	static void list();

	/// add a new ship model
	static void add(ShipModel *shipmodel);
};

}

#endif // __INCLUDED_GAME_SHIPMODEL_H__