1
0

EntityTableSystem.cs 652 B

1234567891011121314151617181920
  1. using Content.Shared.EntityTable.EntitySelectors;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Random;
  4. namespace Content.Shared.EntityTable;
  5. public sealed class EntityTableSystem : EntitySystem
  6. {
  7. [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
  8. [Dependency] private readonly IRobustRandom _random = default!;
  9. public IEnumerable<EntProtoId> GetSpawns(EntityTableSelector? table, System.Random? rand = null)
  10. {
  11. if (table == null)
  12. return new List<EntProtoId>();
  13. rand ??= _random.GetRandom();
  14. return table.GetSpawns(rand, EntityManager, _prototypeManager);
  15. }
  16. }