2019-11-12 08:20:03 +11:00
|
|
|
using Content.Server.GameObjects.Components.Nutrition;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Shared.GameObjects.Systems;
|
|
|
|
|
|
2020-08-13 14:40:27 +02:00
|
|
|
namespace Content.Server.GameObjects.EntitySystems
|
2019-11-12 08:20:03 +11:00
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
2020-08-13 22:17:12 +10:00
|
|
|
internal sealed class ThirstSystem : EntitySystem
|
2019-11-12 08:20:03 +11:00
|
|
|
{
|
|
|
|
|
private float _accumulatedFrameTime;
|
|
|
|
|
|
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
{
|
|
|
|
|
_accumulatedFrameTime += frameTime;
|
|
|
|
|
if (_accumulatedFrameTime > 1.0f)
|
|
|
|
|
{
|
2020-08-13 22:17:12 +10:00
|
|
|
foreach (var component in ComponentManager.EntityQuery<ThirstComponent>())
|
2019-11-12 08:20:03 +11:00
|
|
|
{
|
2020-08-13 22:17:12 +10:00
|
|
|
component.OnUpdate(_accumulatedFrameTime);
|
2019-11-12 08:20:03 +11:00
|
|
|
}
|
2020-08-13 22:17:12 +10:00
|
|
|
_accumulatedFrameTime -= 1.0f;
|
2019-11-12 08:20:03 +11:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|