Files
Delta-v/Content.Server/GameTicking/Rules/SandboxRuleSystem.cs
T
deltanedasanddeltanedas 92fc8da526 move gamerule components to shared (#28572)
* move MinMax to shared

* cleanup MinMax

* move other ticking components to shared just because

* remove unused prototype file

* update everything to use shared components

* test

* test 2

* test 3

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-08-09 19:42:00 +01:00

23 lines
811 B
C#

using Content.Server.GameTicking.Rules.Components;
using Content.Server.Sandbox;
using Content.Shared.GameTicking.Components;
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;
}
}