2020-01-08 15:17:00 -08:00
|
|
|
|
using Content.Server.GameObjects.Components.Movement;
|
|
|
|
|
|
using Robust.Shared.Interfaces.GameObjects;
|
2019-08-10 05:19:52 -07:00
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
using Robust.Shared.Maths;
|
2019-04-04 16:18:43 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Interfaces.GameObjects.Components.Movement
|
|
|
|
|
|
{
|
|
|
|
|
|
// Does nothing except ensure uniqueness between mover components.
|
|
|
|
|
|
// There can only be one.
|
|
|
|
|
|
public interface IMoverComponent : IComponent
|
|
|
|
|
|
{
|
2019-08-10 05:19:52 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Movement speed (m/s) that the entity walks.
|
|
|
|
|
|
/// </summary>
|
2020-02-22 23:37:56 +00:00
|
|
|
|
float CurrentWalkSpeed { get; }
|
2019-04-04 16:18:43 +02:00
|
|
|
|
|
2019-08-10 05:19:52 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Movement speed (m/s) that the entity sprints.
|
|
|
|
|
|
/// </summary>
|
2020-02-22 23:37:56 +00:00
|
|
|
|
float CurrentSprintSpeed { get; }
|
2019-08-10 05:19:52 -07:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Is the entity Sprinting (running)?
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
bool Sprinting { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Calculated linear velocity direction of the entity.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Vector2 VelocityDir { get; }
|
|
|
|
|
|
|
|
|
|
|
|
GridCoordinates LastPosition { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
float StepSoundDistance { get; set; }
|
2020-01-08 15:17:00 -08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Toggles one of the four cardinal directions. Each of the four directions are
|
|
|
|
|
|
/// composed into a single direction vector, <see cref="PlayerInputMoverComponent.VelocityDir"/>. Enabling
|
|
|
|
|
|
/// opposite directions will cancel each other out, resulting in no direction.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="direction">Direction to toggle.</param>
|
|
|
|
|
|
/// <param name="enabled">If the direction is active.</param>
|
|
|
|
|
|
void SetVelocityDirection(Direction direction, bool enabled);
|
2019-04-04 16:18:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|