protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item) { switch (itemTypeString) { case "weapon": { item = new Weapon(itemNameString, itemLocation); return item; } case "wood": { item = new Wood(itemNameString, itemLocation); return item; } case "iron": { item = new Iron(itemNameString, itemLocation); return item; } default: { return base.CreateItem(itemTypeString, itemNameString, itemLocation, item); } } }
public void TravelTo(Location location) { if (location != null) { this.Location = location; } }
protected override Person CreatePerson(string personTypeString, string personNameString, Location personLocation) { switch (personTypeString) { case "merchant": return new Merchant(personNameString, personLocation); default: return base.CreatePerson(personTypeString, personNameString, personLocation); } }
protected override Person CreatePerson(string personTypeString, string personNameString, Location personLocation) { Person person = null; switch (personTypeString) { case "merchant": person = new Merchant(personNameString, personLocation); break; default: return base.CreatePerson(personTypeString, personNameString, personLocation); } return person; }
protected Item(string name, int itemValue, string type, Location location = null) : base(name) { this.Value = itemValue; foreach (var itemType in (ItemType[])Enum.GetValues(typeof(ItemType))) { if (itemType.ToString() == type) { this.ItemType = itemType; } } }
protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item) { switch (itemTypeString) { case "weapon": item = new Weapon(itemNameString, itemLocation); break; case "iron": item = new Iron(itemNameString, itemLocation); break; default: return base.CreateItem(itemTypeString, itemNameString, itemLocation,item); break; } return item; }
protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item) { Item itemToBeCreated = null; switch (itemTypeString) { case "weapon": itemToBeCreated = new Weapon(itemNameString, itemLocation); break; case "wood": itemToBeCreated = new Wood(itemNameString, itemLocation); break; default: itemToBeCreated = base.CreateItem(itemTypeString, itemNameString, itemLocation, itemToBeCreated); break; } return itemToBeCreated; }
protected virtual Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item) { switch (itemTypeString) { case "armor": item = new Armor(itemNameString, itemLocation); break; case "weapon": item = new Weapon(itemNameString, itemLocation); break; case "wood": item = new Wood(itemNameString, itemLocation); break; case "iron": item = new Iron(itemNameString, itemLocation); break; default: break; } return item; }
protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item) { if (itemTypeString == "armor") { base.CreateItem(itemTypeString, itemNameString, itemLocation, item); } switch (itemTypeString) { case "weapon": item = new Weapon(itemNameString, itemLocation); break; case "wood": item = new Wood(itemNameString, itemLocation); break; case "iron": item = new Iron(itemNameString, itemLocation); break; default: break; } return item; }
public Weapon(string name, Location location = null) : base(name, Weapon.InitialValue, ItemType.Weapon, location) { }
public Iron(string name, string type, Location location = null) : base(name, 3, type, location) { }
protected Item(string name, int itemValue, ItemType type, Location location = null) : base(name) { this.Value = itemValue; this.ItemType = type; }
public Iron(string name, Location location = null) : base(name, Iron.GeneralIronValue, ItemType.Iron, location) { }
protected virtual Person CreatePerson(string personTypeString, string personNameString, Location personLocation) { Person person = null; switch (personTypeString) { case "shopkeeper": person = new Shopkeeper(personNameString, personLocation); break; case "traveller": person = new Traveller(personNameString, personLocation); break; default: break; } return person; }
public Weapon(string name, string type, Location location = null) : base(name, 10, type, location) {}
public Wood(string name, string type, Location location = null) : base(name, 2, type, location) { }
public Armor(string name, Location location = null) : base(name, Armor.GeneralArmorValue, ItemType.Armor, location) { }
public Person(string name, Location location) : base(name) { this.Location = location; this.inventoryItems = new HashSet<Item>(); }
public Iron(string name, Location location = null) : base(name, Iron.MoneyValue, ItemType.Iron, location) { }
public Wood(string name, Location location = null) : base(name, 2, ItemType.Wood, location) { }
public Weapon(string name, Location location = null) : base(name, 10, ItemType.Weapon, location) { }
public Iron(string name, Location location = null) : base(name, 3, ItemType.Iron, location) { }
public Merchant(string name, Location location) : base(name, location) { }
public Shopkeeper(string name, Location location) : base(name, location) { }
public virtual void TravelTo(Location location) { this.Location = location; }
public Traveller(string name, Location location) : base(name, location) { }
public Wood(string name, Location location = null) : base(name, GeneralWoodValue, ItemType.Wood, location) { }
public Wood(string name, Location location = null) : base(name, Wood.MoneyValue, ItemType.Wood, location) { }
public Weapon(string name, Location location = null) : base(name, Weapon.GeneralWeaponValue, ItemType.Weapon, location) { }
protected override Person CreatePerson(string personTypeString, string personNameString, Location personLocation) { if (personTypeString != "merchant") { return base.CreatePerson(personTypeString, personNameString, personLocation); } Person person = null; person = new Merchant(personNameString, personLocation); return person; }