Files
tbd-station-14/Content.Server/Nutrition/EntitySystems/ThirstSystem.cs
2021-10-18 23:58:34 +11:00

27 lines
707 B
C#

using Content.Server.Nutrition.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
namespace Content.Server.Nutrition.EntitySystems
{
[UsedImplicitly]
public class ThirstSystem : EntitySystem
{
private float _accumulatedFrameTime;
public override void Update(float frameTime)
{
_accumulatedFrameTime += frameTime;
if (_accumulatedFrameTime > 1)
{
foreach (var component in EntityManager.EntityQuery<ThirstComponent>())
{
component.OnUpdate(_accumulatedFrameTime);
}
_accumulatedFrameTime -= 1;
}
}
}
}