Gamerule Entities, Take 2 (#15765)

This commit is contained in:
Nemanja
2023-04-25 20:23:14 -04:00
committed by GitHub
parent 08ccb5367e
commit 59349b1b9b
124 changed files with 3102 additions and 4344 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;
}
}