Replace IResettingEntitySystem with RoundRestartCleanupEvent. (#4245)

* Replace IResettingEntitySystem with RoundRestartCleanupEvent.

* oops
This commit is contained in:
Vera Aguilera Puerto
2021-06-29 15:56:07 +02:00
committed by GitHub
parent 16e1c2c798
commit bc7b315b18
27 changed files with 136 additions and 66 deletions

View File

@@ -9,12 +9,19 @@ using Robust.Shared.Timing;
namespace Content.Server.APC
{
[UsedImplicitly]
internal sealed class ApcNetSystem : EntitySystem, IResettingEntitySystem
internal sealed class ApcNetSystem : EntitySystem
{
[Dependency] private readonly IPauseManager _pauseManager = default!;
private HashSet<IApcNet> _apcNets = new();
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
}
public override void Update(float frameTime)
{
foreach (var apcNet in _apcNets)
@@ -35,7 +42,7 @@ namespace Content.Server.APC
_apcNets.Remove(apcNet);
}
public void Reset()
public void Reset(RoundRestartCleanupEvent ev)
{
// NodeGroupSystem does not remake ApcNets affected during restarting until a frame later,
// when their grid is invalid. So, we are clearing them on round restart.