Card card = new Card("name", "desc", null, 20);
Console.WriteLine(err.GetType().Name + ": " + err.Message);
public abstract class Race
public abstract short GetMaxAge();
public virtual short GetMinAge()
return (short)(GetMaxAge() / 5);
public Card(string name, string description, Race race, short age)
this.description = description;
private void ValidateData()
if (name.Length > 50) throw new ArgumentOutOfRangeException("The name cannot be longer than 64 characters!");
if (name.Length == 0) throw new ArgumentException("The name cannot be empty!");
if (description.Length > 8000) throw new ArgumentOutOfRangeException("The description cannot be longer than 8000 characters! Your description length:");
if (age < race.GetMinAge()) throw new ArgumentOutOfRangeException("Your character is too young!");
if (age > race.GetMaxAge()) throw new ArgumentOutOfRangeException("Your character is too old!");