diff options
author | Stijn Buys <ingar@osirion.org> | 2009-11-12 20:53:35 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-11-12 20:53:35 +0000 |
commit | 5ddb64795cc959916eeedbec8dc3f65c06f49698 (patch) | |
tree | ee7231607b0bf49528570e5d3badcdedcb33f54e /src/core/inventory.h | |
parent | 3605a7bd8fffebfba38d31025b6f33cb82626a3b (diff) |
initial commodities and entity inventory, bump network proto version to 18
Diffstat (limited to 'src/core/inventory.h')
-rw-r--r-- | src/core/inventory.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/core/inventory.h b/src/core/inventory.h new file mode 100644 index 0000000..0a1db92 --- /dev/null +++ b/src/core/inventory.h @@ -0,0 +1,64 @@ +/* + core/inventory.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_CORE_INVENTORY_H__ +#define __INCLUDED_CORE_INVENTORY_H__ + +#include "core/item.h" + +#include <vector> + +namespace core +{ + +/** + * @brief an entity inventory + */ +class Inventory +{ +public: + /** + * @brief type definition for the items in the inventory + */ + typedef std::vector<Item *> Items; + + /** + * @brief default constructor + */ + Inventory(); + + /** + * @brief default destructor + */ + ~Inventory(); + + /** + * @brief add an item to the inventory + */ + void add(Item *item); + + /** + * @brief remove an item from the inventory and delete it + */ + void remove(Item *item); + + /** + * @brief removes all items from the inventory and delete them + */ + void clear(); + + /** + * @brief search the inventory for a specific item type + */ + Item *find(unsigned int const class_id, unsigned int const info_id); + +private: + Items inventory_items; +}; + +} // namsepace core + +#endif // __INCLUDED_CORE_INVENTORY_H__ |