using System; using JetBrains.Annotations; using Robust.Client.Graphics; using Robust.Client.Physics; using Robust.Client.Player; using Robust.Shared.GameObjects; using Robust.Shared.Input; using Robust.Shared.Input.Binding; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Timing; #nullable enable namespace Robust.Client.GameObjects { /// /// Updates the position of every Eye every frame, so that the camera follows the player around. /// [UsedImplicitly] public sealed class EyeUpdateSystem : EntitySystem { /// public override void Initialize() { base.Initialize(); //WARN: Tightly couples this system with InputSystem, and assumes InputSystem exists and is initialized CommandBinds.Builder .Bind(EngineKeyFunctions.CameraRotateRight, new NullInputCmdHandler()) .Bind(EngineKeyFunctions.CameraRotateLeft, new NullInputCmdHandler()) .Register(); // Make sure this runs *after* entities have been moved by interpolation and movement. UpdatesAfter.Add(typeof(TransformSystem)); UpdatesAfter.Add(typeof(PhysicsSystem)); } /// public override void Shutdown() { //WARN: Tightly couples this system with InputSystem, and assumes InputSystem exists and is initialized CommandBinds.Unregister(); base.Shutdown(); } /// public override void FrameUpdate(float frameTime) { foreach (var eyeComponent in EntityManager.EntityQuery(true)) { eyeComponent.UpdateEyePosition(); } } } }