From 1ec56d83093009814dd099f173b8895a65153c63 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Date: Sun, 24 Apr 2022 01:39:22 +0200 Subject: [PATCH] Adds EntityLootTable prototype. (#7722) --- .../EntityList/EntityLootTablePrototype.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Content.Shared/EntityList/EntityLootTablePrototype.cs diff --git a/Content.Shared/EntityList/EntityLootTablePrototype.cs b/Content.Shared/EntityList/EntityLootTablePrototype.cs new file mode 100644 index 0000000000..8b61543fbc --- /dev/null +++ b/Content.Shared/EntityList/EntityLootTablePrototype.cs @@ -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 Entries = ImmutableList.Empty; + + /// + public List GetSpawns(IRobustRandom? random = null) + { + return EntitySpawnCollection.GetSpawns(Entries, random); + } +}