/// <summary>
/// Method called when an actor picks up an item from the ground.
/// Replaces the old owner and deletes the itemtile from the map
/// </summary>
/// <param name="actor">The actor which gains the item</param>
public void Pickup(Actor actor)
{
if (_owner != null)
{
_owner.inventory.Remove(this);
}
_owner = actor;
int temp = 0;
if (_itemType != Backend.ItemType.Gold)
{
for (int i = 0; i < actor.inventory.Count; ++i)
{
temp = Math.Max(id, actor.inventory[i].id);
}
_id = temp + 1;
actor.AddItem(this);
}
else
{
actor.gold += _value;
}
_tile = null;
}