mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* push * fix * push * abstract and more accurate * new abstract method I guess * that table does not explode * webedit major * Update Content.Shared/EntityTable/ValueSelector/BinomialNumberSelector.cs Co-authored-by: SnappingOpossum <snappingopossum@outlook.com> * big ass merge conflicts * sadas * review --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: Tayrtahn <tayrtahn@gmail.com> Co-authored-by: SnappingOpossum <snappingopossum@outlook.com>
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using System.Linq;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.EntityTable.EntitySelectors;
|
|
|
|
/// <summary>
|
|
/// Gets spawns from all of the child selectors
|
|
/// </summary>
|
|
public sealed partial class AllSelector : EntityTableSelector
|
|
{
|
|
[DataField(required: true)]
|
|
public List<EntityTableSelector> Children;
|
|
|
|
protected override IEnumerable<EntProtoId> GetSpawnsImplementation(System.Random rand,
|
|
IEntityManager entMan,
|
|
IPrototypeManager proto,
|
|
EntityTableContext ctx)
|
|
{
|
|
foreach (var child in Children)
|
|
{
|
|
foreach (var spawn in child.GetSpawns(rand, entMan, proto, ctx))
|
|
{
|
|
yield return spawn;
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override IEnumerable<(EntProtoId spawn, double)> ListSpawnsImplementation(IEntityManager entMan, IPrototypeManager proto, EntityTableContext ctx)
|
|
{
|
|
foreach (var child in Children)
|
|
{
|
|
foreach (var (spawn, prob) in child.ListSpawns(entMan, proto, ctx))
|
|
{
|
|
yield return (spawn, prob);
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override IEnumerable<(EntProtoId spawn, double)> AverageSpawnsImplementation(IEntityManager entMan, IPrototypeManager proto, EntityTableContext ctx)
|
|
{
|
|
foreach (var child in Children)
|
|
{
|
|
foreach (var (spawn, prob) in child.AverageSpawns(entMan, proto, ctx))
|
|
{
|
|
yield return (spawn, prob);
|
|
}
|
|
}
|
|
}
|
|
}
|