From 0c509866a37ab47ff0e48d357ca55e31658c37c2 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 16 Sep 2010 14:12:27 +0000 Subject: map info support, initial trade window --- src/core/parser.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core/parser.cc') diff --git a/src/core/parser.cc b/src/core/parser.cc index c5e0a38..7ef44d9 100644 --- a/src/core/parser.cc +++ b/src/core/parser.cc @@ -11,6 +11,17 @@ namespace core { +InfoType *Parser::entity_infotype = 0; + +void Parser::init() +{ + entity_infotype = new InfoType("entity"); +} + +void Parser::done() +{ + entity_infotype = 0; +} bool Parser::got_entity_key(filesystem::IniFile &inifile, core::Entity *entity) { @@ -47,6 +58,13 @@ bool Parser::got_entity_key(filesystem::IniFile &inifile, core::Entity *entity) return false; } + } else if (inifile.got_key_string("info", strval)) { + if (!entity->info()) { + entity->set_info(new Info(entity_infotype, entity->label().c_str())); + } + entity->info()->add_text(strval); + return true; + } else if (inifile.got_key_string("label", strval)) { entity->set_label(strval); return true; -- cgit v1.2.3