/// <summary> /// Method to set a player's ability to a certain level. /// </summary> /// <param name="ability">Ability to be changed</param> /// <param name="level">New level</param> public void SetAbility(AbilityName ability, int level) { switch (ability) { case AbilityName.Immunity: Immunity = new Immunity(level); break; case AbilityName.TreatsGalore: TreatsGalore = new TreatsGalore(level); break; case AbilityName.Fearless: Fearless = new Fearless(level); break; case AbilityName.FatMouse: FatMouse = new FatMouse(level); break; case AbilityName.ScaryCat: ScaryCat = new ScaryCat(level); break; case AbilityName.BeastlyBuffet: BeastlyBuffet = new BeastlyBuffet(level); break; case AbilityName.Thief: Thief = new Thief(level); break; default: throw new ArgumentOutOfRangeException("ability", ability, "No such ability."); } }
public Abilities(int immunityLevel, int treatsGaloreLevel, int fearlessLevel, int fatMouseLevel, int scaryCatLevel, int beastlyBuffetLevel, int thiefLevel) { Immunity = new Immunity(immunityLevel); TreatsGalore = new TreatsGalore(treatsGaloreLevel); Fearless = new Fearless(fearlessLevel); FatMouse = new FatMouse(fatMouseLevel); ScaryCat = new ScaryCat(scaryCatLevel); BeastlyBuffet = new BeastlyBuffet(beastlyBuffetLevel); Thief = new Thief(thiefLevel); }