Ejemplo n.º 1
0
 public Human(CivilizationManager civilManager, string name, HumanSex sex)
 {
     CivilManager  = civilManager;
     Name          = name;
     Sex           = sex;
     DieAge        = RandomSelector.GetRandomDouble(CivilManager.GetSystem <SocialSystem>().Config.MaximumAge);
     _stateMachine = new HumanStateMachine(this);
 }
Ejemplo n.º 2
0
 public Human(string name, string surname, string lastName, DateTime birthDate, HumanSex sex)
 {
     Name      = name;
     Surname   = surname;
     LastName  = lastName;
     BirthDate = birthDate;
     Sex       = sex;
 }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        public HumanRecord CreateRecord(MarriageRecord marriageRecord, string name, HumanSex sex)
        {
            Human human;

            if (sex == HumanSex.Male)
            {
                human = new Man(CivilManager, name);
            }
            else
            {
                human = new Woman(CivilManager, name);
            }

            HumanRecord record = new HumanRecord(human, marriageRecord);

            AddRecord(record);
            return(record);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        public static string GetRandomName(HumanSex sex)
        {
            NamesFileResource resource = ResourceManager.GetResource <NamesFileResource>(sex == HumanSex.Female ? "FemaleNames" : "MaleNames");

            return(resource.GetRandomName());
        }
Ejemplo n.º 7
0
 public Person(HumanSex sex)
 {
     Sex = sex;
 }