diff options
author | Stijn Buys <ingar@osirion.org> | 2009-04-15 17:08:51 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-04-15 17:08:51 +0000 |
commit | a95028547981614e06ea7a6d22b853b85418cea3 (patch) | |
tree | d4d6998a4118a4d8690ce138d586abfba4893179 /src/game/base/shipmodel.cc | |
parent | 4f33f59571f10019c1e7a0e3640b2f69c159a8cf (diff) |
added info registry, list_info
added network info transfer
added info based buy menu and related game changes
Diffstat (limited to 'src/game/base/shipmodel.cc')
-rw-r--r-- | src/game/base/shipmodel.cc | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/game/base/shipmodel.cc b/src/game/base/shipmodel.cc index 78dc125..fc4781a 100644 --- a/src/game/base/shipmodel.cc +++ b/src/game/base/shipmodel.cc @@ -43,11 +43,42 @@ void ShipModel::clear() void ShipModel::print() { con_print << "label: ^B" << label() << " ^Nname: ^B" << name() << std::endl; + con_print << " price: ^B" << price() << std::endl; con_print << " acceleration: ^B" << acceleration() << std::endl; con_print << " turnspeed: ^B" << turnspeed() << std::endl; con_print << " max speed: ^B" << maxspeed() << std::endl; - con_print << " max cargo: ^B" << maxcargo() << std::endl; - con_print << " price: ^B" << price() << std::endl; + con_print << " cargo: ^B" << maxcargo() << std::endl; +} + +void ShipModel::generate_info(core::Info *info) +{ + info->clear_text(); + + info->set_name(name()); + info->set_modelname(modelname()); + + // info text form ships.ini + for (core::Info::Text::iterator it = shipmodel_infotext.begin(); it != shipmodel_infotext.end(); it++) { + info->add_text((*it)); + } + + info->add_text(""); + info->add_text("^BSpecifications:^N"); + std::stringstream str; + str << "price: ^B" << price() << " ^Ncredits"; + info->add_text(str.str()); str.str(""); + + str << "cargo hold: ^B" << 0.1f * maxcargo() << " ^Nmetric tonnes"; + info->add_text(str.str()); str.str(""); + + str << "top speed: ^B" << 100.0f * maxspeed() << " ^Nmps"; + info->add_text(str.str()); str.str(""); + + str << "response: ^B" << turnspeed() << " ^Ndps"; + info->add_text(str.str()); str.str(""); + + str << "acceleration: ^B" << acceleration() << " ^Nstandard"; + info->add_text(str.str()); str.str(""); } void ShipModel::list() |