예제 #1
0
        public static Botan CreatePair(CoolParent parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("null parent");
            }
            Sex randomSex = Randomizer.GetRandomSex();

            return(new Botan(Randomizer.GetRandomStudentAge(), NamesHelper.GenerateName(randomSex), randomSex, NamesHelper.PatronymicFromName(randomSex, parent.Name), MoneyHelper.MoneyToMark(parent.Money)));
        }
예제 #2
0
        public static Student CreatePair(Parent parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("null parent");
            }
            Sex randomSex = Randomizer.GetRandomSex();

            return(new Student(Randomizer.GetRandomStudentAge(), NamesHelper.GenerateName(randomSex), randomSex, NamesHelper.PatronymicFromName(randomSex, parent.Name)));
        }
예제 #3
0
        public static Parent CreatePair(Student student)
        {
            if (student == null)
            {
                throw new ArgumentNullException("null student");
            }
            if (student.Patronymic.Length < 5)
            {
                throw new ArgumentException("Too short patronymic name");
            }

            var name = NamesHelper.NameFromPatronymic(student.Sex, student.Patronymic);

            return(new Parent(Randomizer.GetRandomParentAgeFromStudent(student.Age), name, Sex.Man, 1 + rnd.Next(maxChildsNum - 1))); // he surely has 1 child
        }
예제 #4
0
 public Human CreateHuman(Sex sex)
 {
     return(new Botan(Randomizer.GetRandomStudentAge(), NamesHelper.GenerateName(sex), sex, NamesHelper.GeneratePatronymic(sex), GetRandomAvgMark()));
 }
예제 #5
0
 public Human CreateHuman(Sex sex)
 {
     return(new Parent(Randomizer.GetRandomParentAge(), NamesHelper.GenerateName(Sex.Man), Sex.Man, rnd.Next(maxChildsNum)));
 }