Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-11-13 22:25:09 +0000
committerStijn Buys <ingar@osirion.org>2009-11-13 22:25:09 +0000
commita993d31910b63a1f897e470842934e6ffefad32c (patch)
treefef52482d762acbbd35e97f382b60ff24ce5071f /src/core/gameconnection.cc
parent5ddb64795cc959916eeedbec8dc3f65c06f49698 (diff)
added core::InfoType, refactored game::ShipModel as core::Info subclass, introduced core::Label
Diffstat (limited to 'src/core/gameconnection.cc')
-rw-r--r--src/core/gameconnection.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc
index c0a769c..064974c 100644
--- a/src/core/gameconnection.cc
+++ b/src/core/gameconnection.cc
@@ -90,15 +90,21 @@ bool GameConnection::interactive() const
return true;
}
-Info *GameConnection::info(const std::string &label)
+Info *GameConnection::info(const std::string &type, const std::string &label)
{
+ // find the class
+ InfoType *infotype = InfoType::find(type);
+ if (!infotype)
+ return 0;
+
// check if we already have the info record
- Info *info = Info::find(label);
+ Info *info = Info::find(infotype, label);
if (info)
return info;
// create a new information record and set the label
- info = new Info(label);
+ info = new Info(0);
+ info->set_label(label);
info->text().push_back("Requesting information...");
// send an information request to the server