2021-06-20 10:09:24 +02:00
|
|
|
using Content.Server.GameTicking;
|
|
|
|
|
using Content.Server.Spawners.Components;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Spawners.EntitySystems
|
|
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
public class ConditionalSpawnerSystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<GameRuleAddedEvent>(OnRuleAdded);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnRuleAdded(GameRuleAddedEvent args)
|
|
|
|
|
{
|
2021-09-28 13:35:29 +02:00
|
|
|
foreach (var spawner in EntityManager.EntityQuery<ConditionalSpawnerComponent>())
|
2021-06-20 10:09:24 +02:00
|
|
|
{
|
|
|
|
|
spawner.RuleAdded(args);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|