using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace LD_24.Code { /// /// Class for a single hero /// public class Hero : Actor, IComparable, IEquatable { /// /// Power points of hero /// public int Power { get; set; } /// /// Agility points of hero /// public int Agility { get; set; } /// /// Intellect points of hero /// public int Intellect { get; set; } /// /// Special points of hero /// public int Special { get; set; } public Hero(string race, string startingTown, string name, string @class, int health, int mana, int attack, int defense, int power, int agility, int intellect, int special) : base(race, startingTown, name, @class, health, mana, attack, defense) { Power = power; Agility = agility; Intellect = intellect; Special = special; } /// /// Compare hero to hero by intellect /// /// /// public int CompareTo(Hero other) { return Intellect.CompareTo(other.Intellect); } /// /// Check if 2 heros have the same intellect /// /// /// public bool Equals(Hero other) { return Intellect.Equals(other.Intellect); } /// /// Serialize a hero to a CSV line /// /// public override string ToCSVLine() { return string.Join(";", Race, StartingTown, Name, Class, Health, Mana, Attack, Defense, Power, Agility, Intellect, Special); } } }