* Server EntitySystem cleanup I went after low-hanging fruit systems. * Add / change to internal access modifiers to systems * Use EntityQuery to get components instead * Add sealed modifier to systems * Remove unused imports * Add jetbrains annotation for unused classes * Removed some pragmas for dependencies This should also fix a decent chunk of the server build warnings, at least the ones that matter. * Also disposals * Update Content.Server/GameObjects/EntitySystems/GravitySystem.cs * Fix build Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
26 lines
700 B
C#
26 lines
700 B
C#
using Content.Server.GameObjects.Components.Projectiles;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects.Systems;
|
|
|
|
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
|
|
{
|
|
[UsedImplicitly]
|
|
internal sealed class ProjectileSystem : EntitySystem
|
|
{
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
foreach (var component in ComponentManager.EntityQuery<ProjectileComponent>())
|
|
{
|
|
component.TimeLeft -= frameTime;
|
|
|
|
if (component.TimeLeft <= 0)
|
|
{
|
|
component.Owner.Delete();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|