2020-06-30 18:34:42 +02:00
|
|
|
using System;
|
|
|
|
|
using Content.Server.GameObjects.Components;
|
|
|
|
|
using JetBrains.Annotations;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2020-06-30 18:34:42 +02:00
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.GameObjects.EntitySystems
|
|
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
2020-08-13 22:17:12 +10:00
|
|
|
internal sealed class StressTestMovementSystem : EntitySystem
|
2020-06-30 18:34:42 +02:00
|
|
|
{
|
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
{
|
|
|
|
|
base.Update(frameTime);
|
|
|
|
|
|
2021-02-04 00:20:48 +11:00
|
|
|
foreach (var stressTest in ComponentManager.EntityQuery<StressTestMovementComponent>(true))
|
2020-06-30 18:34:42 +02:00
|
|
|
{
|
2020-08-13 22:17:12 +10:00
|
|
|
var transform = stressTest.Owner.Transform;
|
2020-06-30 18:34:42 +02:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|