2020-06-30 18:34:42 +02:00
|
|
|
using System;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Movement.Components;
|
2020-06-30 18:34:42 +02:00
|
|
|
using JetBrains.Annotations;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 14:20:34 +01:00
|
|
|
using Robust.Shared.IoC;
|
2020-06-30 18:34:42 +02:00
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Movement
|
2020-06-30 18:34:42 +02:00
|
|
|
{
|
|
|
|
|
[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-09-28 13:35:29 +02:00
|
|
|
foreach (var stressTest in EntityManager.EntityQuery<StressTestMovementComponent>(true))
|
2020-06-30 18:34:42 +02:00
|
|
|
{
|
2021-12-08 19:39:03 +01:00
|
|
|
var transform = EntityManager.GetComponent<TransformComponent>(stressTest.Owner);
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|