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)); } }
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)); } }
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)); } } }
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)); } } }