コード例 #1
0
 protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item)
 {
     switch (itemTypeString)
     {
         case "weapon":
             return new Weapon(itemNameString, itemLocation);
         case "wood":
             return new Wood(itemNameString, itemLocation);
         case "iron":
             return new Iron(itemNameString, itemLocation);
         default:
             return base.CreateItem(itemTypeString, itemNameString, itemLocation, item);
     }
 }
コード例 #2
0
 public void RemoveFromInventory(Item item)
 {
     this.inventoryItems.Remove(item);
 }
コード例 #3
0
 public void AddToInventory(Item item)
 {
     this.inventoryItems.Add(item);
 }