2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Lathe.Components;
|
2020-08-13 22:17:12 +10:00
|
|
|
using JetBrains.Annotations;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2019-04-26 15:51:05 +02:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Lathe
|
2019-04-26 15:51:05 +02:00
|
|
|
{
|
2020-08-13 22:17:12 +10:00
|
|
|
[UsedImplicitly]
|
|
|
|
|
internal sealed class LatheSystem : EntitySystem
|
2019-04-26 15:51:05 +02:00
|
|
|
{
|
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
{
|
2021-10-18 14:58:34 +02:00
|
|
|
foreach (var comp in EntityManager.EntityQuery<LatheComponent>())
|
2019-04-26 15:51:05 +02:00
|
|
|
{
|
|
|
|
|
if (comp.Producing == false && comp.Queue.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
comp.Produce(comp.Queue.Dequeue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|