private HumanoidCharacterProfile(
     HumanoidCharacterProfile other,
     Dictionary <string, JobPriority> jobPriorities,
     List <string> antagPreferences)
     : this(other.Name, other.Age, other.Sex, other.Gender, other.Appearance, other.Clothing, other.Backpack,
            jobPriorities, other.PreferenceUnavailable, antagPreferences)
 {
 }
Example #2
0
 public static PlayerPreferences Default()
 {
     return(new PlayerPreferences(new List <ICharacterProfile>
     {
         HumanoidCharacterProfile.Default()
     },
                                  0));
 }
 public static PlayerPreferences Default()
 {
     return(new PlayerPreferences
     {
         Characters = new List <ICharacterProfile>
         {
             HumanoidCharacterProfile.Default()
         },
         SelectedCharacterIndex = 0
     });
 }
Example #4
0
        public static HumanoidCharacterProfile EnsureValid(
            HumanoidCharacterProfile profile,
            IPrototypeManager prototypeManager)
        {
            var age = Math.Clamp(profile.Age, MinimumAge, MaximumAge);
            var sex = profile.Sex switch
            {
                Sex.Male => Sex.Male,
                Sex.Female => Sex.Female,
                _ => Sex.Male // Invalid enum values.
            };

            string name;

            if (string.IsNullOrEmpty(profile.Name))
            {
                name = "John Doe";
            }
            else if (profile.Name.Length > MaxNameLength)
            {
                name = profile.Name[..MaxNameLength];
 private HumanoidCharacterProfile(HumanoidCharacterProfile other)
     : this(other, new Dictionary <string, JobPriority>(other.JobPriorities), new List <string>(other.AntagPreferences))
 {
 }