/* 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 namespace core { /** * @brief an entity inventory */ class Inventory { public: /** * @brief type definition for the items in the inventory */ typedef std::vector 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(const Info *info); inline Items &items() { return inventory_items; }; private: Items inventory_items; }; } // namsepace core #endif // __INCLUDED_CORE_INVENTORY_H__