diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-12 00:03:31 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-12 00:03:31 +0000 |
commit | d07d7e0d0ba022d555f418e9a072d71c190ed225 (patch) | |
tree | 40428732c2eab0796e7c4b8b8089cbf58ecea76e /src/game/base/shipmodel.h | |
parent | 128d1f7b752a25f2fd2ee105c9acfe8f9d1b9be5 (diff) |
read factions.ini and add te ablity to apply faction colors to entities,
read templates.ini and add te ablity to apply template settings to entities.
Diffstat (limited to 'src/game/base/shipmodel.h')
-rw-r--r-- | src/game/base/shipmodel.h | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/game/base/shipmodel.h b/src/game/base/shipmodel.h index c7aa2ba..9da50a6 100644 --- a/src/game/base/shipmodel.h +++ b/src/game/base/shipmodel.h @@ -11,6 +11,7 @@ #include "core/info.h" #include "core/entity.h" +#include "base/template.h" namespace game { @@ -76,6 +77,18 @@ public: inline const float maxcargo() const { return shipmodel_maxcargo; } + + /// ship radius + inline const float radius() const { + return shipmodel_radius; + } + + /// entity template + inline const Template *model_template() const { + return shipmodel_template; + } + +protected: /* ---- mutators -------------------------------------------------- */ @@ -129,11 +142,22 @@ public: inline void set_dock(const bool dock) { shipmodel_dock = dock; } + + /// set radius + inline void set_radius(const float radius) { + shipmodel_radius = radius; + } + + /// set entity template + inline void set_template(const Template *model_template) { + shipmodel_template = model_template; + } +public: void generate_info(); void buy(core::EntityControlable *buyer, core::Entity *seller); - + /* --- static registry functions ---------------------------------- */ static ShipModel *find(const std::string & label); @@ -143,10 +167,15 @@ public: static bool init(); static void list(); + + static inline const core::InfoType *infotype() { + return shipmodel_infotype; + } - static core::InfoType *shipmodel_infotype; - -private: +private: + /* --- attributes ------------------------------------------------- */ + + float shipmodel_radius; float shipmodel_mass; float shipmodel_impulse_force; float shipmodel_thrust_force; @@ -159,6 +188,12 @@ private: bool shipmodel_jumpdrive; bool shipmodel_dock; + + const Template *shipmodel_template; + + /* --- static ----------------------------------------------------- */ + + static core::InfoType *shipmodel_infotype; }; } |