mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Remove all uses of System.Random * Use IRobustRandom in BinomialNumberSelector.Get * Remove remaining ToolRefinableSystem S.Random inst
32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Shared.EntityTable.EntitySelectors;
|
|
|
|
/// <summary>
|
|
/// Gets the spawns from the entity table prototype specified.
|
|
/// Can be used to reuse common tables.
|
|
/// </summary>
|
|
public sealed partial class NestedSelector : EntityTableSelector
|
|
{
|
|
[DataField(required: true)]
|
|
public ProtoId<EntityTablePrototype> TableId;
|
|
|
|
protected override IEnumerable<EntProtoId> GetSpawnsImplementation(IRobustRandom rand,
|
|
IEntityManager entMan,
|
|
IPrototypeManager proto,
|
|
EntityTableContext ctx)
|
|
{
|
|
return proto.Index(TableId).Table.GetSpawns(rand, entMan, proto, ctx);
|
|
}
|
|
|
|
protected override IEnumerable<(EntProtoId spawn, double)> ListSpawnsImplementation(IEntityManager entMan, IPrototypeManager proto, EntityTableContext ctx)
|
|
{
|
|
return proto.Index(TableId).Table.ListSpawns(entMan, proto, ctx);
|
|
}
|
|
|
|
protected override IEnumerable<(EntProtoId spawn, double)> AverageSpawnsImplementation(IEntityManager entMan, IPrototypeManager proto, EntityTableContext ctx)
|
|
{
|
|
return proto.Index(TableId).Table.AverageSpawns(entMan, proto, ctx);
|
|
}
|
|
}
|