private void ParseCorpes(string corps) { bool validCorps = Enum.TryParse(typeof(CorpsEnum), corps, out object outCorps); if (validCorps == false) { throw new ArgumentException("Invalid corps!"); } this.Corps = (CorpsEnum)outCorps; }
public Engineer(string id, string firstName, string lastName, decimal salary, CorpsEnum corps) : base(id, firstName, lastName, salary, corps) { this.Repairs = new Dictionary <string, int>(); }
public SpecialisedSoldier(string id, string firstName, string lastName, decimal salary, CorpsEnum corps) : base(id, firstName, lastName) { this.Salary = salary; this.Corps = corps; }