Example #1
0
 /// <summary>
 /// The item is removed when an item is used.
 /// </summary>
 /// <param name="item">Item.</param>
 private void RemoveItem(Item item)
 {
     foreach (Stack <Item> itemStack in items)
     {
         if (itemStack.Count > 0)
         {
             if (itemStack.Peek().GetType() == item.GetType())
             {
                 itemStack.Pop();
                 blackBoard.RemoveFromItemKnowledge(item.ItemWSEffector);
                 OnItemRemoved(items.IndexOf(itemStack), itemStack.Count);
                 item.OnItemUse -= Handle_OnItemUse;
                 break;
             }
         }
     }
 }