LauriM/ProjectIce — pull request #10 by abramsba (2013-07-31 10:41:36+00:00)
Title: BaseItem & Inventory

A inventory has been created instead of a ItemSystem. My idea with the item system was to act as a sort of cache for getting item definitions quickly but on second glance I think it's too early to decide. How items will be defined later (JSON, XML, CSV, whatever) should be discussed as well.

BaseItem has a few methods:
`````cpp
// Called when the player wants to completely remove an item
BaseItem::onDestroy( player::Player * pOwner ) = 0;

// Called when a player wants to pickup and item
BaseItem::onPickup( player::Player * pOwner ) = 0;

// Called when a player wants to drop an item in the world
BaseItem::onDrop( player::Player * pOwner ) = 0;

// Called when the player wants to examine a potion
BaseItem::onInspect( player::Player * pOwner ) = 0;

// Called when the player requests to use the item
BaseItem::onUse( player::Player * pOwner ) = 0;
`````

As of right now they're actually impelemented as just voids but the idea is use this object as an abstract base. those functions you can define in your own Item implementations. However since I don't have a specific idea in mind I'll just leave it at this for now.

These functions are called from Inventory.