/* game/shipmodel.cc This file is part of the Osirion project and is distributed under the terms and conditions of the GNU General Public License version 2 */ #include "sys/sys.h" #include "game/shipmodel.h" namespace game { // the ship model registry std::list ShipModel::registry; ShipModel::ShipModel() { //default specifications shipmodel_acceleration = 1.0f; shipmodel_maxspeed = 3.0f; shipmodel_turnspeed = 0.1f; add(this); } ShipModel::~ShipModel() {} // clear the ship model registry void ShipModel::clear() { for (std::list< ShipModel *>::iterator smit=registry.begin(); smit != registry.end(); smit++) { delete (*smit); } registry.clear(); } void ShipModel::list() { for (std::list< ShipModel *>::iterator smit=registry.begin(); smit != registry.end(); smit++) { con_print << " " << (*smit)->modelname() << " " << (*smit)->name() << " accel " << (*smit)->acceleration() << " max " << (*smit)->maxspeed() << " turn " << (*smit)->turnspeed() << "\n"; } con_print << registry.size() << " registered ship models\n"; } // add a new ship model void ShipModel::add(ShipModel *shipmodel) { registry.push_back(shipmodel); } }