From 8f393ff70e60172c632efc81694433568df2862b Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 25 Dec 2014 15:58:24 +0000 Subject: Added a core::Level type, added a level attribute to core::Entity and core::Info, updated core::Player to use the new type. --- src/core/commandbuffer.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/core/commandbuffer.cc') diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc index 11a48b4..4234f0e 100644 --- a/src/core/commandbuffer.cc +++ b/src/core/commandbuffer.cc @@ -61,13 +61,27 @@ void func_list_info(std::string const &args) InfoType *infotype = InfoType::find(typestr); if(!(argstream >> labelstr)) { - // a single argument + // single argument - infotype label if (infotype) { // list all the records of a single type Info::list(infotype); return; } + // single argument - info record id + std::istringstream idstream(typestr); + unsigned int id; + if (idstream >> id) + { + info = Info::find(id); + if (info) { + // list a single record + info->print(); + return; + } + } + + // single argument - info record exact label match info = Info::find(typestr); if (info) { // list a single record @@ -75,6 +89,7 @@ void func_list_info(std::string const &args) return; } + // single argument - info recrod label search info = Info::search(typestr); if (info) { // list a single record -- cgit v1.2.3