2019-08-13 23:43:44 +02:00
|
|
|
using Content.Server.GameObjects.Components.Projectiles;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Shared.GameObjects.Systems;
|
|
|
|
|
|
2020-08-13 14:40:27 +02:00
|
|
|
namespace Content.Server.GameObjects.EntitySystems
|
2019-08-13 23:43:44 +02:00
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
internal sealed class ProjectileSystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
{
|
|
|
|
|
base.Update(frameTime);
|
|
|
|
|
|
2020-08-13 22:17:12 +10:00
|
|
|
foreach (var component in ComponentManager.EntityQuery<ProjectileComponent>())
|
2019-08-13 23:43:44 +02:00
|
|
|
{
|
|
|
|
|
component.TimeLeft -= frameTime;
|
|
|
|
|
|
|
|
|
|
if (component.TimeLeft <= 0)
|
|
|
|
|
{
|
2020-08-13 22:17:12 +10:00
|
|
|
component.Owner.Delete();
|
2019-08-13 23:43:44 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|