From f33257521bf80dcef8575c4fc3ddaf4a40ff588a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 7 Jun 2009 18:13:15 +0000 Subject: fixed a few widget order problems, changed map targetting behaviour --- src/core/item.h | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'src/core/item.h') diff --git a/src/core/item.h b/src/core/item.h index 68b6876..d390c2d 100644 --- a/src/core/item.h +++ b/src/core/item.h @@ -11,22 +11,45 @@ namespace core { -class Item +/** + * @brief a class of items + * Examples are armor, cannons, commodities... + */ +class ItemClass { public: - Item(const unsigned int itemclass, const unsigned int itemtype, const char *infolabel); - ~Item(); + ItemClass(const char *label); - inline const unsigned int itemclass() const { return item_class; } - inline const unsigned int itemtype() const { return item_type; } - + inline const std::string &label() { return itemclass_label; } + + inline const std::string &name() { return itemclass_name; } + +private: + std::string itemclass_label; + std::string itemclass_name; +}; + +/** + * @brief a specific type of item in the game + * Examples are tritanium hull armor, ion cannon, gems + */ +class ItemType +{ +public: + ItemType(const char *label); + + inline const std::string &label() { return itemtype_label; } + + inline const std::string &name() { return itemtype_name; } + + inline const float base_price() { return itemtype_baseprice; } private: - unsigned int item_class; - unsigned int item_type; - float item_amount; + std::string itemtype_label; + std::string itemtype_name; - std::string item_infolabel; + ItemClass *itemtype_class; + float itemtype_baseprice; }; } -- cgit v1.2.3