예제 #1
0
        public Person(string FirstName, Person Father, Person Mother, Gender.Genders Gender, DateTime Birthdate)
        {
            this.FirstName = FirstName;
            LastName       = Father.LastName;
            this.Father    = Father;
            this.Mother    = Mother;
            this.Gender    = Gender;
            this.Birthdate = Birthdate;
            this.State     = new Healthy();
            RaceFactory raceFactory = new RaceFactory();

            Race     = raceFactory.CreateRace(Father, Mother);
            Children = new List <Person>();
        }
예제 #2
0
        public Person MakeBaby(DateTime born, String Mname, String Fname)
        {
            RaceFactory factory = new RaceFactory();

            var race = factory.CreateRace(Father, Mother);

            Person Child;
            Person ChildsMother;
            Person ChildsFather;

            if (Gender == Riku_fighter.Gender.Genders.female)
            {
                ChildsMother = this;
                ChildsFather = Partner;
            }
            else
            {
                ChildsMother = Partner;
                ChildsFather = this;
            }

            if (Gender != Partner.Gender)
            {
                Probability getGender = new Probability(2);
                if (getGender.rInt == 0)
                {
                    if (Father.Race.GetType() == typeof(Mongoloid))
                    {
                        Child = new Mongoloid(Fname, ChildsFather, ChildsMother, Mother.Gender, born);
                    }
                    else if (Father.Race.GetType() == typeof(Australoid))
                    {
                        Child = new Australoid(Fname, ChildsFather, ChildsMother, Mother.Gender, born);
                    }
                    else if (Father.Race.GetType() == typeof(Negroid))
                    {
                        Child = new Negroid(Fname, ChildsFather, ChildsMother, Mother.Gender, born);
                    }
                    else
                    {
                        Child = new Caucasoid(Fname, ChildsFather, ChildsMother, Mother.Gender, born);
                    }

                    Children.Add(Child);
                    Partner.Children.Add(Child);
                }
                else
                {
                    if (Father.Race.GetType() == typeof(Mongoloid))
                    {
                        Child = new Mongoloid(Mname, ChildsFather, ChildsMother, Father.Gender, born);
                    }
                    else if (Father.Race.GetType() == typeof(Australoid))
                    {
                        Child = new Australoid(Mname, ChildsFather, ChildsMother, Father.Gender, born);
                    }
                    else if (Father.Race.GetType() == typeof(Negroid))
                    {
                        Child = new Negroid(Mname, ChildsFather, ChildsMother, Father.Gender, born);
                    }
                    else
                    {
                        Child = new Caucasoid(Mname, ChildsFather, ChildsMother, Father.Gender, born);
                    }
                    Children.Add(Child);
                    Partner.Children.Add(Child);
                }
                return(Child);
            }
            else
            {
                Child = null;
                return(Child);
            }
        }