public void Unequip(Armor i) { if (i == null) { return; } Armortype key = null; //check if it even exists in the set foreach (KeyValuePair <Armortype, Armor> a in this.Armors) { if (a.Value == i) { key = a.Key; break; } } //then remove if (key != null) { i.unequip(); Armors.Remove(key); foreach (DamageType d in DamageType.allDamageTypes()) { increaseDamageBlock(d, -i.getArmor(d)); } } }
public Armor(float slashArmor, float bluntarmor, float pokearmor, Armortype t, int weight, int worth, string name) : this(new Dictionary <DamageType, float> { { DamageType.Slash, slashArmor }, { DamageType.Poke, pokearmor }, { DamageType.Blunt, bluntarmor }, } , t, weight, worth, name) { }
public Armor(Dictionary <DamageType, float> Armorvals, Armortype t, int weight, int worth, string name) : base(weight, worth, name, "Armor") { this.armorvals = Armorvals; type = t; actions.Add(new GenericOption("equip", () => Player.getInstance().EquipArmor(this))); }
public Armor getItem(Armortype a) { return(this.Armors[a]); }