Files
OldThink/Content.Client/GameObjects/EntitySystems/InstrumentSystem.cs

37 lines
979 B
C#
Raw Normal View History

2020-05-20 17:13:49 +02:00
using Content.Client.GameObjects.Components.Instruments;
2020-05-29 22:50:41 +02:00
using JetBrains.Annotations;
2020-05-18 13:29:31 +02:00
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
2020-05-29 22:50:41 +02:00
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
2020-05-18 13:29:31 +02:00
2020-05-20 17:13:49 +02:00
namespace Content.Client.GameObjects.EntitySystems
2020-05-18 13:29:31 +02:00
{
2020-05-29 22:50:41 +02:00
[UsedImplicitly]
2020-05-18 13:29:31 +02:00
public class InstrumentSystem : EntitySystem
{
2020-06-08 14:44:11 +02:00
[Dependency] private readonly IGameTiming _gameTiming = default;
2020-05-29 22:50:41 +02:00
2020-05-18 13:29:31 +02:00
public override void Initialize()
{
base.Initialize();
2020-05-20 17:13:49 +02:00
EntityQuery = new TypeEntityQuery(typeof(InstrumentComponent));
2020-05-18 13:29:31 +02:00
}
public override void Update(float frameTime)
{
base.Update(frameTime);
2020-05-29 22:50:41 +02:00
if (!_gameTiming.IsFirstTimePredicted)
{
return;
}
2020-05-18 13:29:31 +02:00
foreach (var entity in RelevantEntities)
{
2020-05-20 17:13:49 +02:00
entity.GetComponent<InstrumentComponent>().Update(frameTime);
2020-05-18 13:29:31 +02:00
}
}
}
}