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-14 14:14:21 +0000
committerStijn Buys <ingar@osirion.org>2009-11-14 14:14:21 +0000
commit4293e8854a30443e4d5818fc55df404976dbfd9b (patch)
tree816665ba37acfd5a39c0544c3b2acbf04c8c5d3d /src/core/info.h
parenta993d31910b63a1f897e470842934e6ffefad32c (diff)
update the info system, fixes network info exchange
Diffstat (limited to 'src/core/info.h')
-rw-r--r--src/core/info.h64
1 files changed, 12 insertions, 52 deletions
diff --git a/src/core/info.h b/src/core/info.h
index 13f38f8..0296ec9 100644
--- a/src/core/info.h
+++ b/src/core/info.h
@@ -19,62 +19,40 @@ namespace core
{
/**
- * @brief an object class information record
- * Describes a class of object
+ * @brief an information record type
+ * The InfoType groups information records of the same type
*/
class InfoType : public Label
{
public:
/**
- * @brief create a server side object class information record
+ * @brief create a new information record type
+ * The constructor automaticly adds the instance to the registry
*/
InfoType(const char* label);
- /**
- * @brief create a client side object class information record
- */
- InfoType(const unsigned int id);
-
- virtual ~InfoType();
-
- /* ---- inspectors ------------------------------------------------- */
-
- inline const unsigned int id() const {
- return infotype_id;
- }
-
-private:
-
- unsigned int infotype_id;
-
+ virtual ~InfoType();
/* ---- static infoclass registry ---------------------------------- */
-
-public:
+
/// clear infotype registry
static void clear();
/// search the infotype registry for a label
static InfoType *find(const std::string & label);
- /// search the infotype registry for an id
- static InfoType *find(const unsigned int id);
-
-
private:
/// info registry type definition
typedef std::vector<InfoType*> Registry;
static Registry infotype_registry;
- static unsigned int infotype_id_counter;
-
}; // class InfoType
/**
* @brief an information record
* An information record holds extended information about a specific entity or item class.
- * This information isexchanged between server and the client, and can be used to build
- * HUD widgets/
+ * This information is exchanged between server and the client, and can be used to build
+ * HUD widgets.
*/
class Info : public Label
{
@@ -83,26 +61,16 @@ public:
typedef std::deque<std::string> Text;
/**
- * @brief create a new server-side information record
- * This is a server-side constructor and assigns an id
+ * @brief create a new information record
+ * The constructor automaticly adds the instance to the registry
*/
- Info();
+ Info(const InfoType *type = 0);
- /**
- * @brief create a new client-side information record
- * This is a client-side constructor
- */
- Info(const unsigned int id);
-
/// delete the information record
virtual ~Info();
/* ---- inspectors ------------------------------------------------- */
- inline const unsigned int id() const {
- return info_id;
- }
-
inline const InfoType* type() const {
return info_type;
}
@@ -173,7 +141,6 @@ public:
private:
const InfoType* info_type;
- unsigned int info_id;
long info_price;
unsigned long info_timestamp;
std::string info_modelname;
@@ -199,9 +166,6 @@ public:
/// search the info registry for a label
static Info *find(const std::string & label);
- /// search the info registry for an id
- static Info *find(const unsigned int id);
-
/// search the info registry for a record with a matching label or name
static Info *search(const std::string & searchstr);
@@ -211,9 +175,6 @@ public:
/// search the info registry for a label, belonging to a specific class
static Info *find(const InfoType *type, const std::string & label);
- /// search the info registry for an id, belonging to a specific class
- static Info *find(const InfoType *type, const unsigned int id);
-
/// search the info registry for a record with a matching label or name and belonging to a specific class
static Info *search(const InfoType *type, const std::string & searchstr);
@@ -224,11 +185,10 @@ public:
static void list();
/// list a single class in the info registry
- static void list_class(const InfoType *type);
+ static void list(const InfoType *type);
private:
static Registry info_registry;
- static unsigned int info_id_counter;
};
}