Hunger ECS (#14939)

This commit is contained in:
Nemanja
2023-04-02 22:42:30 -04:00
committed by GitHub
parent 19277a2276
commit 0f0b534239
14 changed files with 440 additions and 364 deletions

View File

@@ -1,27 +0,0 @@
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Nutrition.Components;
using Robust.Shared.GameObjects;
namespace Content.Client.Nutrition.Components
{
[RegisterComponent]
[ComponentReference(typeof(SharedHungerComponent))]
public sealed class HungerComponent : SharedHungerComponent
{
private HungerThreshold _currentHungerThreshold;
public override HungerThreshold CurrentHungerThreshold => _currentHungerThreshold;
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
base.HandleComponentState(curState, nextState);
if (curState is not HungerComponentState hunger)
{
return;
}
_currentHungerThreshold = hunger.CurrentThreshold;
}
}
}