Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959)
* Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out * Missed one * Missed another * Fix data field ids
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.EntityList
|
||||
{
|
||||
@@ -11,14 +10,14 @@ namespace Content.Shared.EntityList
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
[DataField("entities", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
public ImmutableList<string> EntityIds { get; private set; } = ImmutableList<string>.Empty;
|
||||
[DataField]
|
||||
public ImmutableList<EntProtoId> Entities { get; private set; } = ImmutableList<EntProtoId>.Empty;
|
||||
|
||||
public IEnumerable<EntityPrototype> Entities(IPrototypeManager? prototypeManager = null)
|
||||
public IEnumerable<EntityPrototype> GetEntities(IPrototypeManager? prototypeManager = null)
|
||||
{
|
||||
prototypeManager ??= IoCManager.Resolve<IPrototypeManager>();
|
||||
|
||||
foreach (var entityId in EntityIds)
|
||||
foreach (var entityId in Entities)
|
||||
{
|
||||
yield return prototypeManager.Index<EntityPrototype>(entityId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user