Пример #1
0
        public Girl(Living living)
        {
            Gender = Sex.FEMALE;

            FamilyName = living.FamilyName;
            GivenName  = living.GivenName;
            BirthYear  = living.BirthYear;
            Parentage  = living.Parentage;
            Issue      = living.Issue;
            ID         = living.ID;
        }
Пример #2
0
        public static Living Born(Family parentage)
        {
            Living living = new Living
            {
                Gender     = random.NextDouble() > 0.5D ? Sex.FEMALE : Sex.MALE,
                BirthYear  = Program.Year,
                Parentage  = parentage,
                FamilyName = parentage.Father.FamilyName
            };

            switch (living.Gender)
            {
            case Sex.MALE:
                living.GivenName = Naming.BoyName();
                return(new Boy(living));

            case Sex.FEMALE:
                living.GivenName = Naming.GirlName();
                return(new Girl(living));

            default:
                throw new Exception("Genderless agent!");
            }
        }