Re-organize all projects (#4166)
This commit is contained in:
38
Content.Server/Climbing/ClimbSystem.cs
Normal file
38
Content.Server/Climbing/ClimbSystem.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Climbing.Components;
|
||||
using Content.Shared.GameTicking;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Climbing
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class ClimbSystem : EntitySystem, IResettingEntitySystem
|
||||
{
|
||||
private readonly HashSet<ClimbingComponent> _activeClimbers = new();
|
||||
|
||||
public void AddActiveClimber(ClimbingComponent climbingComponent)
|
||||
{
|
||||
_activeClimbers.Add(climbingComponent);
|
||||
}
|
||||
|
||||
public void RemoveActiveClimber(ClimbingComponent climbingComponent)
|
||||
{
|
||||
_activeClimbers.Remove(climbingComponent);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
foreach (var climber in _activeClimbers.ToArray())
|
||||
{
|
||||
climber.Update();
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_activeClimbers.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user