Adds EntityLootTable prototype. (#7722)

This commit is contained in:
Vera Aguilera Puerto
2022-04-24 01:39:22 +02:00
committed by GitHub
parent cbe6f620e7
commit 1ec56d8309

View File

@@ -0,0 +1,22 @@
using System.Collections.Immutable;
using Content.Shared.Storage;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Shared.EntityList;
[Prototype("entityLootTable")]
public sealed class EntityLootTablePrototype : IPrototype
{
[IdDataField]
public string ID { get; } = default!;
[DataField("entries")]
public ImmutableList<EntitySpawnEntry> Entries = ImmutableList<EntitySpawnEntry>.Empty;
/// <inheritdoc cref="EntitySpawnCollection.GetSpawns"/>
public List<string> GetSpawns(IRobustRandom? random = null)
{
return EntitySpawnCollection.GetSpawns(Entries, random);
}
}