示例#1
0
        public static HumanoidCharacterProfile Random()
        {
            var random = IoCManager.Resolve <IRobustRandom>();
            var sex    = random.Prob(0.5f) ? Sex.Male : Sex.Female;

            var firstName = random.Pick(sex == Sex.Male
                ? Names.MaleFirstNames
                : Names.FemaleFirstNames);
            var lastName = random.Pick(Names.LastNames);
            var name     = $"{firstName} {lastName}";
            var age      = random.Next(MinimumAge, MaximumAge);

            return(new HumanoidCharacterProfile(name, age, sex, HumanoidCharacterAppearance.Random(sex),
                                                new Dictionary <string, JobPriority>
            {
                { SharedGameTicker.OverflowJob, JobPriority.High }
            }, PreferenceUnavailableMode.StayInLobby, new List <string>()));
        }
        public static HumanoidCharacterProfile Random()
        {
            var random = IoCManager.Resolve <IRobustRandom>();
            var sex    = random.Prob(0.5f) ? Sex.Male : Sex.Female;
            var gender = sex == Sex.Male ? Gender.Male : Gender.Female;

            var prototypeManager = IoCManager.Resolve <IPrototypeManager>();
            var firstName        = random.Pick(sex.FirstNames(prototypeManager).Values);
            var lastName         = random.Pick(prototypeManager.Index <DatasetPrototype>("names_last"));
            var name             = $"{firstName} {lastName}";
            var age = random.Next(MinimumAge, MaximumAge);

            return(new HumanoidCharacterProfile(name, age, sex, gender, HumanoidCharacterAppearance.Random(sex), ClothingPreference.Jumpsuit, BackpackPreference.Backpack,
                                                new Dictionary <string, JobPriority>
            {
                { SharedGameTicker.OverflowJob, JobPriority.High }
            }, PreferenceUnavailableMode.StayInLobby, new List <string>()));
        }
        public static HumanoidCharacterProfile Random()
        {
            var prototypeManager = IoCManager.Resolve <IPrototypeManager>();
            var random           = IoCManager.Resolve <IRobustRandom>();

            var species = random.Pick(prototypeManager
                                      .EnumeratePrototypes <SpeciesPrototype>().Where(x => x.RoundStart).ToArray()).ID;
            var sex    = random.Prob(0.5f) ? Sex.Male : Sex.Female;
            var gender = sex == Sex.Male ? Gender.Male : Gender.Female;

            var name = sex.GetName(species, prototypeManager, random);
            var age  = random.Next(MinimumAge, MaximumAge);

            return(new HumanoidCharacterProfile(name, "", species, age, sex, gender, HumanoidCharacterAppearance.Random(sex), ClothingPreference.Jumpsuit, BackpackPreference.Backpack,
                                                new Dictionary <string, JobPriority>
            {
                { SharedGameTicker.FallbackOverflowJob, JobPriority.High }
            }, PreferenceUnavailableMode.StayInLobby, new List <string>()));
        }