public override bool InitializeSystem()
        {
            HumanSex sex            = RandomSelector.GetRandomEnumValue <HumanSex>();
            var      family1Husband = HumanRecords.CreateRecord(null, RandomSelector.GetRandomName(HumanSex.Male), HumanSex.Male);
            var      family1Wife    = HumanRecords.CreateRecord(null, RandomSelector.GetRandomName(HumanSex.Female), HumanSex.Female);

            var family2Husband = HumanRecords.CreateRecord(null, RandomSelector.GetRandomName(HumanSex.Male), HumanSex.Male);
            var family2Wife    = HumanRecords.CreateRecord(null, RandomSelector.GetRandomName(HumanSex.Female), HumanSex.Female);

            MarriageRecords.CreateRecord(family1Husband.Human as Man, family1Wife.Human as Woman);
            MarriageRecords.CreateRecord(family2Husband.Human as Man, family2Wife.Human as Woman);

            return(base.InitializeSystem());
        }
Exemple #2
0
        public void ProduceBaby()
        {
            SocialSystem socialSystem = CivilManager.GetSystem <SocialSystem>();

            var marriageRecord = socialSystem.MarriageRecords.GetRecord(this);
            var dieRecord      = socialSystem.DieRecords.GetRecord(this);

            if (marriageRecord == null || marriageRecord.RecordState == RecordState.Obselete ||
                dieRecord != null)
            {
                return;
            }

            HumanSex childSex  = RandomSelector.GetRandomEnumValue <HumanSex>();
            string   childName = RandomSelector.GetRandomName(childSex);

            socialSystem.HumanRecords.CreateRecord(marriageRecord, childName, childSex);
        }