using System.Numerics; using Content.Shared.Movement.Systems; using Robust.Shared.GameStates; namespace Content.Shared._DV.Movement; /// /// When attached to an entity with an InputMoverComponent, all mob movement on that entity will /// be tile-based. Contains info used to facilitate that movement. /// [RegisterComponent, NetworkedComponent, Access(typeof(TileMovementSystem))] [AutoGenerateComponentState(fieldDeltas: true)] public sealed partial class TileMovementComponent : Component { /// /// Whether a tile movement slide is currently in progress. /// [ViewVariables] public bool SlideActive => MovementKeyPressedAt != null; /// /// Local coordinates from which the current slide first began. /// [AutoNetworkedField] public Vector2 Origin; /// /// Local coordinates of the target of the current slide. /// [AutoNetworkedField] public Vector2 Destination; /// /// This helps determine how long a slide should last. A slide will continue so long /// as a movement key (WASD) is being held down, but if it was held down for less than /// a certain time period then it will continue for a minimum period. /// [AutoNetworkedField] public TimeSpan? MovementKeyPressedAt; /// /// Move buttons used to initiate the current slide. /// [ViewVariables, AutoNetworkedField] public MoveButtons CurrentSlideMoveButtons; /// /// Whether this entity was weightless last physics tick. /// [AutoNetworkedField] public bool WasWeightlessLastTick; /// /// Used to remove TileMovement after pulling stops. /// [DataField, AutoNetworkedField] public bool Temporary; }