Files
OldThink/Content.Server/Lathe/LatheSystem.cs

22 lines
563 B
C#
Raw Normal View History

2021-06-09 22:19:39 +02:00
using Content.Server.Lathe.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
2021-06-09 22:19:39 +02:00
namespace Content.Server.Lathe
{
[UsedImplicitly]
internal sealed class LatheSystem : EntitySystem
{
public override void Update(float frameTime)
{
foreach (var comp in EntityManager.EntityQuery<LatheComponent>())
{
if (comp.Producing == false && comp.Queue.Count > 0)
{
comp.Produce(comp.Queue.Dequeue());
}
}
}
}
}