2019-04-26 15:51:05 +02:00
|
|
|
using Content.Server.GameObjects.Components.Research;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.GameObjects.Systems;
|
|
|
|
|
|
2020-07-06 14:27:03 -07:00
|
|
|
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
|
2019-04-26 15:51:05 +02:00
|
|
|
{
|
|
|
|
|
public class LatheSystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
EntityQuery = new TypeEntityQuery(typeof(LatheComponent));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
{
|
|
|
|
|
foreach (var entity in RelevantEntities)
|
|
|
|
|
{
|
|
|
|
|
var comp = entity.GetComponent<LatheComponent>();
|
|
|
|
|
if (comp.Producing == false && comp.Queue.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
comp.Produce(comp.Queue.Dequeue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|