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-12 20:53:35 +0000
committerStijn Buys <ingar@osirion.org>2009-11-12 20:53:35 +0000
commit5ddb64795cc959916eeedbec8dc3f65c06f49698 (patch)
treeee7231607b0bf49528570e5d3badcdedcb33f54e /src/core/item.cc
parent3605a7bd8fffebfba38d31025b6f33cb82626a3b (diff)
initial commodities and entity inventory, bump network proto version to 18
Diffstat (limited to 'src/core/item.cc')
-rw-r--r--src/core/item.cc100
1 files changed, 11 insertions, 89 deletions
diff --git a/src/core/item.cc b/src/core/item.cc
index 53da74d..a029674 100644
--- a/src/core/item.cc
+++ b/src/core/item.cc
@@ -12,102 +12,24 @@ namespace core
/* ---- class Item ------------------------------------------------- */
-
-Item::Registry Item::item_registry;
-
-void Item::add_class(ItemClass * itemclass)
-{
-
-}
-
-void Item::add_type(ItemClass * itemclass, ItemType *itemtype)
-{
-
-}
-
-void Item::find_class(const char *label)
-{
-
-}
-
-void Item::clear()
-{
- for (Registry::iterator it = item_registry.begin(); it != item_registry.end(); it++) {
- delete(*it);
- }
- item_registry.clear();
-}
-
-void Item::list()
-{
- for (Registry::iterator it = item_registry.begin(); it != item_registry.end(); it++) {
- con_print << " item class ^B " << (*it)->name() << std::endl;
- (*it)->list();
- }
- con_print << item_registry.size() << " registered item classes" << std::endl;
-}
-
-/* ---- class ItemClass -------------------------------------------- */
-
-ItemClass::ItemClass(const char *label)
+Item::Item(const unsigned int class_id, const unsigned int info_id)
{
- if (label) {
- itemclass_label.assign(label);
- } else {
- itemclass_label.clear();
- }
-}
-
-ItemClass::~ItemClass()
-{
- for (Types::iterator it = itemclass_types.begin(); it != itemclass_types.end(); it++) {
- delete(*it);
- }
-}
-
-void ItemClass::list()
-{
-}
-
-void ItemClass::set_name(const std::string &name)
-{
- itemclass_name.assign(name);
-}
-
-void ItemClass::add_type(ItemType *itemtype)
-{
- for (Types::iterator it = itemclass_types.begin(); it != itemclass_types.end(); it++) {
- con_print << " " << (*it)->name() << std::endl;
- }
-}
-
-ItemType *ItemClass::find_type(const char *label)
-{
- return 0;
-}
-
-/* ---- class ItemType --------------------------------------------- */
-
-ItemType::ItemType(const char *label)
-{
- if (label) {
- itemtype_label.assign(label);
- } else {
- itemtype_label.clear();
- }
-
- itemtype_baseprice = 0;
+ item_class_id = class_id;
+ item_info_id = info_id;
+
+ item_amount = 0;
+ item_info = Info::find(info_id);
}
-void ItemType::set_name(const std::string &name)
+Item::~Item()
{
- itemtype_name.assign(name);
+ item_amount = 0;
}
-void ItemType::set_baseprice(const float baseprice)
+void Item::set_amount(const int amount)
{
- itemtype_baseprice = 0;
+ item_amount = amount;
}
-} // class core
+} // namespace core