diff options
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__ |