Files
tbd-station-14/Content.Server/GameObjects/EntitySystems/WelderSystem.cs
DrSmugleaf 5c0cf1b1a0 Use 'new' expression in places where the type is evident for content (#2590)
* Content.Client

* Content.Benchmarks

* Content.IntegrationTests

* Content.Server

* Content.Server.Database

* Content.Shared

* Content.Tests

* Merge fixes

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-27 21:00:49 +11:00

34 lines
925 B
C#

using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.Interactable;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
{
/// <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);
}
}
}
}