Files
tbd-station-14/Content.Server/GameObjects/EntitySystems/StressTestMovementSystem.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

35 lines
1023 B
C#

using System;
using Content.Server.GameObjects.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
namespace Content.Server.GameObjects.EntitySystems
{
[UsedImplicitly]
internal sealed class StressTestMovementSystem : EntitySystem
{
public override void Update(float frameTime)
{
base.Update(frameTime);
foreach (var stressTest in ComponentManager.EntityQuery<StressTestMovementComponent>(true))
{
var transform = stressTest.Owner.Transform;
stressTest.Progress += frameTime;
if (stressTest.Progress > 1)
{
stressTest.Progress -= 1;
}
var x = MathF.Sin(stressTest.Progress * MathHelper.TwoPi);
var y = MathF.Cos(stressTest.Progress * MathHelper.TwoPi);
transform.WorldPosition = stressTest.Origin + (new Vector2(x, y) * 5);
}
}
}
}