コード例 #1
0
        public Adult()
        {
            this.gender = rand.RandomGender();
            this.name = rand.RandomName();
            if (new Random().Next(0, 6) > 2)
            {
                this.child = new Child();
                hasChild = true;
            }

            if (hasChild)
                isBoring = false;
        }
コード例 #2
0
        public Adult(string name, string gender, Child child)
        {
            this.name = name;
            if (gender == "male" || gender == "female")
                this.gender = gender;
            else
                this.gender = new RandomGenerator().RandomGender();
            if (child != null)
                this.child = child;
                hasChild = true;

            if (hasChild)
                isBoring = false;
        }