Gamerule Entities (#15513)

This commit is contained in:
Nemanja
2023-04-24 01:20:51 -04:00
committed by GitHub
parent 8943c2a10e
commit 39cc02b8f9
124 changed files with 3097 additions and 4342 deletions

View File

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