Adds EntityLootTable prototype. (#7722)
This commit is contained in:
committed by
GitHub
parent
cbe6f620e7
commit
1ec56d8309
22
Content.Shared/EntityList/EntityLootTablePrototype.cs
Normal file
22
Content.Shared/EntityList/EntityLootTablePrototype.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user