public Unit(string name, string description, int price, Grade mgrade) : base(name, description, price) { gender = LocalRandom.RandomNumber(0, 100) < 70 ? Gender.Male : Gender.Female; race = LocalRandom.RandomNumber(0, 100) < 95 ? Race.Human : Race.Elf; grade = mgrade; unitName = GenerateName(); weapon = EquipementList.handgun; }
private string GenerateName() { StringBuilder str = new StringBuilder(); for (int i = LocalRandom.RandomNumber(2, 4); i >= 0; i--) { str.Append(syllabes[LocalRandom.RandomNumber(0, syllabes.Length)]); } return(str.ToString()); }