Files
tbd-station-14/Content.Client/Nutrition/Components/ThirstComponent.cs
mirrorcult 2d3077f560 Remove IMoveSpeedModifier in favor of events (#5212)
* Remove IMoveSpeedModifier

* fucking magboots

* yope

* rabiews
2021-11-08 16:17:35 +11:00

29 lines
919 B
C#

using Content.Shared.Movement.Components;
using Content.Shared.Movement.EntitySystems;
using Content.Shared.Nutrition.Components;
using Robust.Shared.GameObjects;
namespace Content.Client.Nutrition.Components
{
[RegisterComponent]
public class ThirstComponent : SharedThirstComponent
{
private ThirstThreshold _currentThirstThreshold;
public override ThirstThreshold CurrentThirstThreshold => _currentThirstThreshold;
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
base.HandleComponentState(curState, nextState);
if (curState is not ThirstComponentState thirst)
{
return;
}
_currentThirstThreshold = thirst.CurrentThreshold;
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(OwnerUid);
}
}
}