/* 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 #include "core/info.h" #include "core/entity.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; } /// indicates if players can dock this ship model inline const bool dock() const { return shipmodel_dock; } /// 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, in cubic meters 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; } /// set dock capability inline void set_dock(const bool dock) { shipmodel_dock = dock; } void generate_info(); void buy(core::EntityControlable *buyer, core::Entity *seller); /* --- static registry functions ---------------------------------- */ static ShipModel *find(const std::string & label); static ShipModel *search(const std::string & searchstr); static bool init(); static void list(); static core::InfoType *shipmodel_infotype; private: bool shipmodel_jumpdrive; bool shipmodel_dock; float shipmodel_acceleration; float shipmodel_maxspeed; float shipmodel_turnspeed; float shipmodel_maxcargo; }; } #endif // __INCLUDED_BASE_SHIPMODEL_H__