adds custom typeserializers (#3676)
This commit is contained in:
@@ -6,6 +6,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Atmos
|
namespace Content.Server.GameObjects.Components.Atmos
|
||||||
@@ -18,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
public override string Name => "Airtight";
|
public override string Name => "Airtight";
|
||||||
|
|
||||||
[DataFieldWithFlag("airBlockedDirection", typeof(AtmosDirectionFlags))]
|
[DataField("airBlockedDirection", customTypeSerializer: typeof(FlagSerializer<AtmosDirectionFlags>))]
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private int _initialAirBlockedDirection = (int) AtmosDirection.All;
|
private int _initialAirBlockedDirection = (int) AtmosDirection.All;
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ using System.Collections.Generic;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Serialization.Manager;
|
using Robust.Shared.Serialization.Manager;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Items.Storage
|
namespace Content.Server.GameObjects.Components.Items.Storage
|
||||||
{
|
{
|
||||||
@@ -59,7 +61,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
|||||||
[DataDefinition]
|
[DataDefinition]
|
||||||
public struct StorageFillEntry : IPopulateDefaultValues
|
public struct StorageFillEntry : IPopulateDefaultValues
|
||||||
{
|
{
|
||||||
[DataField("name")]
|
[DataField("name", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||||
public string? PrototypeName;
|
public string? PrototypeName;
|
||||||
|
|
||||||
[DataField("prob")]
|
[DataField("prob")]
|
||||||
|
|||||||
@@ -90,15 +90,15 @@ namespace Content.YAMLLinter
|
|||||||
|
|
||||||
foreach (var (key, val) in serverErrors)
|
foreach (var (key, val) in serverErrors)
|
||||||
{
|
{
|
||||||
|
var newErrors = val.Where(n => n.AlwaysRelevant).ToHashSet();
|
||||||
if (clientErrors.TryGetValue(key, out var clientVal))
|
if (clientErrors.TryGetValue(key, out var clientVal))
|
||||||
{
|
{
|
||||||
var newErrors = val.Intersect(clientVal).ToHashSet();
|
newErrors.UnionWith(val.Intersect(clientVal));
|
||||||
newErrors.UnionWith(val.Where(n => n.AlwaysRelevant));
|
|
||||||
newErrors.UnionWith(clientVal.Where(n => n.AlwaysRelevant));
|
newErrors.UnionWith(clientVal.Where(n => n.AlwaysRelevant));
|
||||||
if (newErrors.Count == 0) continue;
|
|
||||||
|
|
||||||
allErrors[key] = newErrors;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newErrors.Count == 0) continue;
|
||||||
|
allErrors[key] = newErrors;
|
||||||
}
|
}
|
||||||
|
|
||||||
return allErrors;
|
return allErrors;
|
||||||
|
|||||||
Reference in New Issue
Block a user