Files
tbd-station-14/Content.Server/GameTicking/Rules/SandboxRuleSystem.cs
2023-04-24 15:20:51 +10:00

22 lines
766 B
C#

using Content.Server.GameTicking.Rules.Components;
using Content.Server.Sandbox;
namespace Content.Server.GameTicking.Rules;
public sealed class SandboxRuleSystem : GameRuleSystem<SandboxRuleComponent>
{
[Dependency] private readonly SandboxSystem _sandbox = default!;
protected override void Started(EntityUid uid, SandboxRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
base.Started(uid, component, gameRule, args);
_sandbox.IsSandboxEnabled = true;
}
protected override void Ended(EntityUid uid, SandboxRuleComponent component, GameRuleComponent gameRule, GameRuleEndedEvent args)
{
base.Ended(uid, component, gameRule, args);
_sandbox.IsSandboxEnabled = false;
}
}