From 871be21e83502a909620a5bcfcd09e3257ed0518 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 13 Nov 2010 14:25:39 +0000 Subject: corrected a bug where ship names got erased, made core::Entity::info() const, added core::Info::find() to get non-const *core::Info pointers --- src/core/info.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/core/info.h') diff --git a/src/core/info.h b/src/core/info.h index b8154d7..d32ccab 100644 --- a/src/core/info.h +++ b/src/core/info.h @@ -191,23 +191,38 @@ private: /* ---- static info registry --------------------------------------- */ public: - /// info registry type definition + /** + * @brief info registry type definition + */ typedef std::vector Registry; - /// the info registry + /** + * @brief the info registry + */ static inline Registry & registry() { return info_registry; } - /// search the info registry for a record with the specified id + /** + * @brief search the info registry for a record with the specified id + */ static Info *find(const unsigned int id); - /// search the info registry for a labeled item + /** + * @brief search the info registry for a labeled item + */ static Info *find(const char * label); - /// search the info registry for a label + /** + * @brief search the info registry for a label + */ static Info *find(const std::string & label); + /** + * @brief search the info register for a pointer + */ + static Info *find(const Info *info); + /// search the info registry for a record with a matching label or name static Info *search(const std::string & searchstr); -- cgit v1.2.3