diff options
author | Stijn Buys <ingar@osirion.org> | 2008-06-01 13:03:45 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-06-01 13:03:45 +0000 |
commit | 190cede795ac4c7fcd6865a6c2083b5ce53a154a (patch) | |
tree | f1d05ebec665b0fb66ef2448a81ab2ed718ee279 /src/game/shipmodel.h | |
parent | 2a41efa0d43b573e1c8851086268b8a64d51c511 (diff) |
entity and shipmodel labels, fixes sort order of shipmodels
Diffstat (limited to 'src/game/shipmodel.h')
-rw-r--r-- | src/game/shipmodel.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/game/shipmodel.h b/src/game/shipmodel.h index fd42c81..686d736 100644 --- a/src/game/shipmodel.h +++ b/src/game/shipmodel.h @@ -7,7 +7,7 @@ #ifndef __INCLUDED_GAME_SHIPMODEL_H__ #define __INCLUDED_GAME_SHIPMODEL_H__ -#include <list> +#include <map> #include <string> namespace game { @@ -28,27 +28,35 @@ public: /// turn speed in rotations per second inline float turnspeed() const { return shipmodel_turnspeed; } - /// name of the model to use - inline std::string const & modelname() const { return shipmodel_modelname; } + /// 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::list<ShipModel *> 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(); -private: + /// add a new ship model static void add(ShipModel *shipmodel); }; |