diff options
author | Stijn Buys <ingar@osirion.org> | 2009-11-12 20:53:35 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-11-12 20:53:35 +0000 |
commit | 5ddb64795cc959916eeedbec8dc3f65c06f49698 (patch) | |
tree | ee7231607b0bf49528570e5d3badcdedcb33f54e /src/game/base/shipmodel.h | |
parent | 3605a7bd8fffebfba38d31025b6f33cb82626a3b (diff) |
initial commodities and entity inventory, bump network proto version to 18
Diffstat (limited to 'src/game/base/shipmodel.h')
-rw-r--r-- | src/game/base/shipmodel.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/game/base/shipmodel.h b/src/game/base/shipmodel.h index 0cfe87e..d3048b2 100644 --- a/src/game/base/shipmodel.h +++ b/src/game/base/shipmodel.h @@ -19,7 +19,7 @@ namespace game class ShipModel { public: - ShipModel(); + ShipModel(const unsigned int type_id); ~ShipModel(); void print(); @@ -53,6 +53,11 @@ public: inline const std::string & modelname() const { return shipmodel_modelname; } + + /// type id + inline unsigned int type_id() { + return shipmodel_type_id; + } /// price of the ship inline const long price() const { @@ -89,9 +94,6 @@ public: shipmodel_maxcargo = maxcargo; } - /// generate an info object for this shipmodel - void generate_info(core::Info *info); - /// indicates of this model can be equiped with a jump drive bool shipmodel_jumpdrive; @@ -104,6 +106,8 @@ public: /* ---- static registry ------------------------------------ */ + typedef std::map<std::string, ShipModel *> Registry; + typedef std::map<std::string, ShipModel *>::iterator iterator; /// find an exact match @@ -116,7 +120,7 @@ public: static ShipModel *search(const std::string label); /// the ship model registry - static std::map<std::string, ShipModel *> registry; + static std::map<std::string, ShipModel *> registry; /// clear the ship model registry static void clear(); @@ -126,6 +130,9 @@ public: /// add a new ship model static void add(ShipModel *shipmodel); + + /// generate info records + static void generate_info(); private: @@ -136,6 +143,7 @@ private: long shipmodel_price; + unsigned int shipmodel_type_id; }; } |