Re-organize all projects (#4166)
This commit is contained in:
26
Content.Server/Nutrition/EntitySystems/HungerSystem.cs
Normal file
26
Content.Server/Nutrition/EntitySystems/HungerSystem.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Content.Server.Nutrition.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class HungerSystem : EntitySystem
|
||||
{
|
||||
private float _accumulatedFrameTime;
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
_accumulatedFrameTime += frameTime;
|
||||
|
||||
if (_accumulatedFrameTime > 1)
|
||||
{
|
||||
foreach (var comp in ComponentManager.EntityQuery<HungerComponent>(true))
|
||||
{
|
||||
comp.OnUpdate(_accumulatedFrameTime);
|
||||
}
|
||||
_accumulatedFrameTime -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user