Re-organize all projects (#4166)
This commit is contained in:
33
Content.Server/Tools/WelderSystem.cs
Normal file
33
Content.Server/Tools/WelderSystem.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Tools.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Tools
|
||||
{
|
||||
/// <summary>
|
||||
/// Despite the name, it's only really used for the welder logic in tools. Go figure.
|
||||
/// </summary>
|
||||
public class WelderSystem : EntitySystem
|
||||
{
|
||||
private readonly HashSet<WelderComponent> _activeWelders = new();
|
||||
|
||||
public bool Subscribe(WelderComponent welder)
|
||||
{
|
||||
return _activeWelders.Add(welder);
|
||||
}
|
||||
|
||||
public bool Unsubscribe(WelderComponent welder)
|
||||
{
|
||||
return _activeWelders.Remove(welder);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
foreach (var tool in _activeWelders.ToArray())
|
||||
{
|
||||
tool.OnUpdate(frameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user