mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
27 lines
672 B
C#
27 lines
672 B
C#
using Content.Server.Nutrition.Components;
|
|
using JetBrains.Annotations;
|
|
|
|
namespace Content.Server.Nutrition.EntitySystems
|
|
{
|
|
[UsedImplicitly]
|
|
public sealed class HungerSystem : EntitySystem
|
|
{
|
|
private float _accumulatedFrameTime;
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
_accumulatedFrameTime += frameTime;
|
|
|
|
if (_accumulatedFrameTime > 1)
|
|
{
|
|
foreach (var comp in EntityManager.EntityQuery<HungerComponent>())
|
|
{
|
|
comp.OnUpdate(_accumulatedFrameTime);
|
|
}
|
|
|
|
_accumulatedFrameTime -= 1;
|
|
}
|
|
}
|
|
}
|
|
}
|