コード例 #1
0
 /// <summary>
 /// Adds the item.
 /// </summary>
 /// <param name="item">Item.</param>
 public void AddItem(Item item)
 {
     foreach (Stack <Item> itemStack in items)
     {
         if (itemStack.Count == 0 || itemStack.Peek().GetType() == item.GetType())
         {
             itemStack.Push(item);
             blackBoard.AddToItemKnowledge(item.ItemWSEffector);
             OnItemAdded(items.IndexOf(itemStack), itemStack.Count, item);
             item.OnItemUse += Handle_OnItemUse;
             break;
         }
     }
 }