2021-06-19 19:41:26 -07:00
|
|
|
using System.Collections.Generic;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.NodeContainer.NodeGroups;
|
2020-12-08 11:56:10 +01:00
|
|
|
using JetBrains.Annotations;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2020-07-06 07:48:18 -06:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.NodeContainer.EntitySystems
|
2020-07-06 07:48:18 -06:00
|
|
|
{
|
2020-12-08 11:56:10 +01:00
|
|
|
[UsedImplicitly]
|
2020-07-06 07:48:18 -06:00
|
|
|
public class NodeGroupSystem : EntitySystem
|
|
|
|
|
{
|
2021-06-01 11:34:01 +02:00
|
|
|
private readonly HashSet<INodeGroup> _dirtyNodeGroups = new();
|
|
|
|
|
|
|
|
|
|
public void AddDirtyNodeGroup(INodeGroup nodeGroup)
|
|
|
|
|
{
|
|
|
|
|
_dirtyNodeGroups.Add(nodeGroup);
|
|
|
|
|
}
|
2020-07-06 07:48:18 -06:00
|
|
|
|
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
{
|
|
|
|
|
base.Update(frameTime);
|
2021-06-01 11:34:01 +02:00
|
|
|
|
|
|
|
|
foreach (var group in _dirtyNodeGroups)
|
|
|
|
|
{
|
|
|
|
|
group.RemakeGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_dirtyNodeGroups.Clear();
|
2020-07-06 07:48:18 -06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|