* Remove IActionBlocker.CanMove Ported the remainders over to using MovementAttemptEvent which should also help make mob movement a bit faster. * Make that check faster
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Content.Server.Climbing.Components;
|
|
using Content.Shared.Climbing;
|
|
using Content.Shared.GameTicking;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.Server.Climbing
|
|
{
|
|
[UsedImplicitly]
|
|
internal sealed class ClimbSystem : SharedClimbSystem
|
|
{
|
|
private readonly HashSet<ClimbingComponent> _activeClimbers = new();
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
|
|
}
|
|
|
|
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(RoundRestartCleanupEvent ev)
|
|
{
|
|
_activeClimbers.Clear();
|
|
}
|
|
}
|
|
}
|