예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Person" /> class.
 /// </summary>
 /// <param name="firstName">The first name.</param>
 /// <param name="lastName">The last name.</param>
 /// <param name="dateOfBirth">The date of birth.</param>
 /// <param name="gender">The gender.</param>
 public Person(string firstName, string lastName, DateTime dateOfBirth, GenderE gender)
 {
     FirstName   = firstName;
     LastName    = lastName;
     DateOfBirth = dateOfBirth;
     Gender      = gender;
 }
예제 #2
0
        public Person MakePerson(GenderE gender, string persname, string avname, empStatusE empstatus, bool hasHololens = false, bool flagged = false)
        {
            var pgo = new GameObject(persname);

            pgo.transform.position = Vector3.zero;
            pgo.transform.parent   = this.transform;
            var pers = pgo.AddComponent <Person>();

            pers.AddPrsDetails(this, gender, persname, avname, empstatus, hasHololens);
            AddPersonToCollection(pers); /// has to be afterwards because of the sorted names for journeys
            pers.idleScript  = PersonMan.GetIdleScript(pers.avatarName);
            pers.walkScript  = "PersonRunning";
            pers.danceScript = "Samba Dancing";
            pers.flagged     = flagged;
            return(pers);
        }
예제 #3
0
        public string GenRandomName(GenderE gender)
        {
            int maxiter = 10;// if we can't get a unique name after 10 tries give up :)
            int iter    = 0;

            while (iter < maxiter)
            {
                var genderlist = (gender == GenderE.male ? maleFirstNames : femaleFirstNames);
                var fname      = GraphAlgos.GraphUtil.GetRanListEntry(genderlist, "popbld");
                var lname      = GraphAlgos.GraphUtil.GetRanListEntry(lastNames, "popbld");
                var name       = fname + " " + lname;
                if (!persnamelookup.ContainsKey(name))
                {
                    return(name);
                }
            }
            return("could not find free name");
        }
예제 #4
0
        public void AddPersonToBuildingAtNode(GenderE gender, string roomname, string nodename, string personname, string avatarname, empStatusE empstat,
                                              string idlescript, bool freeToTravel, float homeRotate, bool hasHololens = false, bool hasCamera = false, bool flagged = false)
        {
            var broom = sman.bdman.GetBroom(roomname);
            var bld   = broom.bld;

            var pers = MakePerson(gender, personname, avatarname, empstat, hasHololens);

            pers.AssignHomeLocation(bld.name, broom.name, nodename, homeRoomPlacefixed: true, homeRotate: homeRotate);
            pers.idleScript = idlescript;
            if (!freeToTravel)
            {
                pers.personState = PersonStateE.fixedPerson;
            }
            pers.hasCamera = hasCamera;
            pers.flagged   = true;
            broom.Occupy(pers);
        }
예제 #5
0
        public string GetRandomAvatarName(GenderE gender)
        {
            var rv = "";

            if (gender == GenderE.female)
            {
                var idx = (1 + GraphAlgos.GraphUtil.GetRanInt(sman.maxLegacyAvatarGen, "popbld"));
                if (idx <= 10)
                {
                    rv = "Girl" + idx.ToString("D3");
                }
                else if (idx <= 20)
                {
                    var nidx = idx - 10;
                    rv = "Businesswoman" + nidx.ToString("D3");
                }
                else
                {
                    var nidx = 11 + (idx % 2);
                    rv = "Girl" + nidx.ToString("D3");
                }
            }
            else
            {
                var idx = (1 + GraphAlgos.GraphUtil.GetRanInt(20, "popbld"));
                if (idx <= 10)
                {
                    rv = "Man" + idx.ToString("D3");
                }
                else if (idx <= 20)
                {
                    idx -= 10;
                    rv   = "Businessman" + idx.ToString("D3");
                }
            }
            return(rv);
        }