diff --git a/Content.Server/Fax/FaxMachineComponent.cs b/Content.Server/Fax/FaxMachineComponent.cs index 25ceaf179c..edbc757650 100644 --- a/Content.Server/Fax/FaxMachineComponent.cs +++ b/Content.Server/Fax/FaxMachineComponent.cs @@ -123,20 +123,24 @@ public sealed class FaxMachineComponent : Component [DataDefinition] public sealed class FaxPrintout { - [DataField("name")] - public string Name { get; } + [DataField("name", required: true)] + public string Name { get; } = default!; - [DataField("content")] - public string Content { get; } + [DataField("content", required: true)] + public string Content { get; } = default!; - [DataField("prototypeId", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string PrototypeId { get; } + [DataField("prototypeId", customTypeSerializer: typeof(PrototypeIdSerializer), required: true)] + public string PrototypeId { get; } = default!; [DataField("stampState")] public string? StampState { get; } [DataField("stampedBy")] - public List StampedBy { get; } + public List StampedBy { get; } = new(); + + private FaxPrintout() + { + } public FaxPrintout(string content, string name, string? prototypeId, string? stampState = null, List? stampedBy = null) { diff --git a/Content.Shared/Humanoid/HumanoidCharacterAppearance.cs b/Content.Shared/Humanoid/HumanoidCharacterAppearance.cs index 5d000fd270..4682f302af 100644 --- a/Content.Shared/Humanoid/HumanoidCharacterAppearance.cs +++ b/Content.Shared/Humanoid/HumanoidCharacterAppearance.cs @@ -84,17 +84,16 @@ namespace Content.Shared.Humanoid return new(HairStyleId, HairColor, FacialHairStyleId, FacialHairColor, EyeColor, SkinColor, newMarkings); } - public static HumanoidCharacterAppearance Default() + public HumanoidCharacterAppearance() : this( + HairStyles.DefaultHairStyle, + Color.Black, + HairStyles.DefaultFacialHairStyle, + Color.Black, + Color.Black, + Humanoid.SkinColor.ValidHumanSkinTone, + new () + ) { - return new( - HairStyles.DefaultHairStyle, - Color.Black, - HairStyles.DefaultFacialHairStyle, - Color.Black, - Color.Black, - Humanoid.SkinColor.ValidHumanSkinTone, - new () - ); } public static HumanoidCharacterAppearance DefaultWithSpecies(string species) diff --git a/Content.Shared/Humanoid/Markings/Marking.cs b/Content.Shared/Humanoid/Markings/Marking.cs index c7d5cb6184..1b97939a92 100644 --- a/Content.Shared/Humanoid/Markings/Marking.cs +++ b/Content.Shared/Humanoid/Markings/Marking.cs @@ -12,7 +12,11 @@ namespace Content.Shared.Humanoid.Markings [DataField("markingColor")] private List _markingColors = new(); - private Marking(string markingId, + private Marking() + { + } + + public Marking(string markingId, List markingColors) { MarkingId = markingId; @@ -45,7 +49,7 @@ namespace Content.Shared.Humanoid.Markings /// /// ID of the marking prototype. /// - [DataField("markingId")] + [DataField("markingId", required: true)] public string MarkingId { get; } = default!; /// diff --git a/Content.Shared/Humanoid/Prototypes/HumanoidProfilePrototype.cs b/Content.Shared/Humanoid/Prototypes/HumanoidProfilePrototype.cs index f2177db9f1..a70042e22f 100644 --- a/Content.Shared/Humanoid/Prototypes/HumanoidProfilePrototype.cs +++ b/Content.Shared/Humanoid/Prototypes/HumanoidProfilePrototype.cs @@ -14,5 +14,5 @@ public sealed class HumanoidProfilePrototype : IPrototype public Dictionary CustomBaseLayers = new(); [DataField("profile")] - public HumanoidCharacterProfile Profile { get; } = HumanoidCharacterProfile.Default(); + public HumanoidCharacterProfile Profile { get; } = new(); } diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index 6057588d3c..ecacf14a09 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -102,25 +102,24 @@ namespace Content.Shared.Preferences /// Defaults to for the species. /// /// - public static HumanoidCharacterProfile Default() + public HumanoidCharacterProfile() : this( + "John Doe", + "", + SharedHumanoidAppearanceSystem.DefaultSpecies, + 18, + Sex.Male, + Gender.Male, + new HumanoidCharacterAppearance(), + ClothingPreference.Jumpsuit, + BackpackPreference.Backpack, + new Dictionary + { + {SharedGameTicker.FallbackOverflowJob, JobPriority.High} + }, + PreferenceUnavailableMode.SpawnAsOverflow, + new List(), + new List()) { - return new( - "John Doe", - "", - SharedHumanoidAppearanceSystem.DefaultSpecies, - 18, - Sex.Male, - Gender.Male, - HumanoidCharacterAppearance.Default(), - ClothingPreference.Jumpsuit, - BackpackPreference.Backpack, - new Dictionary - { - {SharedGameTicker.FallbackOverflowJob, JobPriority.High} - }, - PreferenceUnavailableMode.SpawnAsOverflow, - new List(), - new List()); } /// diff --git a/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs b/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs index 8117922d43..125a895740 100644 --- a/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs +++ b/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs @@ -106,7 +106,7 @@ namespace Content.Tests.Server.Preferences var prototypeManager = IoCManager.Resolve(); prototypeManager.Initialize(); prototypeManager.LoadFromStream(new StringReader(Prototypes)); - await db.InitPrefsAsync(username, HumanoidCharacterProfile.Default()); + await db.InitPrefsAsync(username, new HumanoidCharacterProfile()); await db.SaveCharacterSlotAsync(username, CharlieCharlieson(), 1); await db.SaveSelectedCharacterIndexAsync(username, 1); await db.SaveCharacterSlotAsync(username, null, 1);