コード例 #1
0
        private void HandleCraftInteraction(Person actor, string type, string name)
        {
            if (type == "armor" && actor.HasItem(ItemType.Iron))
            {
                this.AddToPerson(actor, new Armor(name));
            }

            if (type == "weapon" && actor.HasItem(ItemType.Iron) && actor.HasItem(ItemType.Wood))
            {
                this.AddToPerson(actor, new Weapon(name));
            }
        }
コード例 #2
0
        private void HandleCraftInteraction(Person actor, string type, string name)
        {
            if (type == "armor" && actor.HasItem(ItemType.Iron))
            {
                this.AddToPerson(actor, new Armor(name));
            }

            if (type == "weapon" && actor.HasItem(ItemType.Iron) && actor.HasItem(ItemType.Wood))
            {
                this.AddToPerson(actor, new Weapon(name));
            }
        }
コード例 #3
0
 private void HandleGatherInteraction(Person actor, string name)
 {
     if (actor.Location is IGatheringLocation)
     {
         var gatheringLocation = actor.Location as IGatheringLocation;
         if (actor.HasItem(gatheringLocation.RequiredItem))
         {
             this.AddToPerson(actor, gatheringLocation.ProduceItem(name));
         }
     }
 }
コード例 #4
0
 private void HandleGatherInteraction(Person actor, string name)
 {
     if (actor.Location is IGatheringLocation)
     {
         var gatheringLocation = actor.Location as IGatheringLocation;
         if (actor.HasItem(gatheringLocation.RequiredItem))
         {
             this.AddToPerson(actor, gatheringLocation.ProduceItem(name));
         }
     }
 }