Add missing DataDefinition constructors (#14603)
This commit is contained in:
@@ -123,20 +123,24 @@ public sealed class FaxMachineComponent : Component
|
|||||||
[DataDefinition]
|
[DataDefinition]
|
||||||
public sealed class FaxPrintout
|
public sealed class FaxPrintout
|
||||||
{
|
{
|
||||||
[DataField("name")]
|
[DataField("name", required: true)]
|
||||||
public string Name { get; }
|
public string Name { get; } = default!;
|
||||||
|
|
||||||
[DataField("content")]
|
[DataField("content", required: true)]
|
||||||
public string Content { get; }
|
public string Content { get; } = default!;
|
||||||
|
|
||||||
[DataField("prototypeId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
[DataField("prototypeId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>), required: true)]
|
||||||
public string PrototypeId { get; }
|
public string PrototypeId { get; } = default!;
|
||||||
|
|
||||||
[DataField("stampState")]
|
[DataField("stampState")]
|
||||||
public string? StampState { get; }
|
public string? StampState { get; }
|
||||||
|
|
||||||
[DataField("stampedBy")]
|
[DataField("stampedBy")]
|
||||||
public List<string> StampedBy { get; }
|
public List<string> StampedBy { get; } = new();
|
||||||
|
|
||||||
|
private FaxPrintout()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public FaxPrintout(string content, string name, string? prototypeId, string? stampState = null, List<string>? stampedBy = null)
|
public FaxPrintout(string content, string name, string? prototypeId, string? stampState = null, List<string>? stampedBy = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,17 +84,16 @@ namespace Content.Shared.Humanoid
|
|||||||
return new(HairStyleId, HairColor, FacialHairStyleId, FacialHairColor, EyeColor, SkinColor, newMarkings);
|
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)
|
public static HumanoidCharacterAppearance DefaultWithSpecies(string species)
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ namespace Content.Shared.Humanoid.Markings
|
|||||||
[DataField("markingColor")]
|
[DataField("markingColor")]
|
||||||
private List<Color> _markingColors = new();
|
private List<Color> _markingColors = new();
|
||||||
|
|
||||||
private Marking(string markingId,
|
private Marking()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Marking(string markingId,
|
||||||
List<Color> markingColors)
|
List<Color> markingColors)
|
||||||
{
|
{
|
||||||
MarkingId = markingId;
|
MarkingId = markingId;
|
||||||
@@ -45,7 +49,7 @@ namespace Content.Shared.Humanoid.Markings
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID of the marking prototype.
|
/// ID of the marking prototype.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("markingId")]
|
[DataField("markingId", required: true)]
|
||||||
public string MarkingId { get; } = default!;
|
public string MarkingId { get; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ public sealed class HumanoidProfilePrototype : IPrototype
|
|||||||
public Dictionary<HumanoidVisualLayers, CustomBaseLayerInfo> CustomBaseLayers = new();
|
public Dictionary<HumanoidVisualLayers, CustomBaseLayerInfo> CustomBaseLayers = new();
|
||||||
|
|
||||||
[DataField("profile")]
|
[DataField("profile")]
|
||||||
public HumanoidCharacterProfile Profile { get; } = HumanoidCharacterProfile.Default();
|
public HumanoidCharacterProfile Profile { get; } = new();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,25 +102,24 @@ namespace Content.Shared.Preferences
|
|||||||
/// Defaults to <see cref="SharedHumanoidAppearanceSystem.DefaultSpecies"/> for the species.
|
/// Defaults to <see cref="SharedHumanoidAppearanceSystem.DefaultSpecies"/> for the species.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static HumanoidCharacterProfile Default()
|
public HumanoidCharacterProfile() : this(
|
||||||
|
"John Doe",
|
||||||
|
"",
|
||||||
|
SharedHumanoidAppearanceSystem.DefaultSpecies,
|
||||||
|
18,
|
||||||
|
Sex.Male,
|
||||||
|
Gender.Male,
|
||||||
|
new HumanoidCharacterAppearance(),
|
||||||
|
ClothingPreference.Jumpsuit,
|
||||||
|
BackpackPreference.Backpack,
|
||||||
|
new Dictionary<string, JobPriority>
|
||||||
|
{
|
||||||
|
{SharedGameTicker.FallbackOverflowJob, JobPriority.High}
|
||||||
|
},
|
||||||
|
PreferenceUnavailableMode.SpawnAsOverflow,
|
||||||
|
new List<string>(),
|
||||||
|
new List<string>())
|
||||||
{
|
{
|
||||||
return new(
|
|
||||||
"John Doe",
|
|
||||||
"",
|
|
||||||
SharedHumanoidAppearanceSystem.DefaultSpecies,
|
|
||||||
18,
|
|
||||||
Sex.Male,
|
|
||||||
Gender.Male,
|
|
||||||
HumanoidCharacterAppearance.Default(),
|
|
||||||
ClothingPreference.Jumpsuit,
|
|
||||||
BackpackPreference.Backpack,
|
|
||||||
new Dictionary<string, JobPriority>
|
|
||||||
{
|
|
||||||
{SharedGameTicker.FallbackOverflowJob, JobPriority.High}
|
|
||||||
},
|
|
||||||
PreferenceUnavailableMode.SpawnAsOverflow,
|
|
||||||
new List<string>(),
|
|
||||||
new List<string>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace Content.Tests.Server.Preferences
|
|||||||
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
|
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
|
||||||
prototypeManager.Initialize();
|
prototypeManager.Initialize();
|
||||||
prototypeManager.LoadFromStream(new StringReader(Prototypes));
|
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.SaveCharacterSlotAsync(username, CharlieCharlieson(), 1);
|
||||||
await db.SaveSelectedCharacterIndexAsync(username, 1);
|
await db.SaveSelectedCharacterIndexAsync(username, 1);
|
||||||
await db.SaveCharacterSlotAsync(username, null, 1);
|
await db.SaveCharacterSlotAsync(username, null, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user