2021-07-17 02:37:09 +02:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2019-08-10 05:19:52 -07:00
|
|
|
|
using Robust.Shared.Maths;
|
2019-04-04 16:18:43 +02:00
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Shared.Movement.Components
|
2019-04-04 16:18:43 +02:00
|
|
|
|
{
|
|
|
|
|
|
// 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>
|
2020-06-24 02:21:20 +02:00
|
|
|
|
bool Sprinting { get; }
|
2019-08-10 05:19:52 -07:00
|
|
|
|
|
2021-11-02 20:35:02 +07:00
|
|
|
|
Angle LastGridAngle { get; set; }
|
|
|
|
|
|
|
2019-08-10 05:19:52 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Calculated linear velocity direction of the entity.
|
|
|
|
|
|
/// </summary>
|
2020-06-24 02:21:20 +02:00
|
|
|
|
(Vector2 walking, Vector2 sprinting) VelocityDir { get; }
|
2019-08-10 05:19:52 -07:00
|
|
|
|
|
2020-01-08 15:17:00 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Toggles one of the four cardinal directions. Each of the four directions are
|
2020-07-03 23:32:41 +02:00
|
|
|
|
/// composed into a single direction vector, <see cref="SharedPlayerInputMoverComponent.VelocityDir"/>. Enabling
|
2020-01-08 15:17:00 -08:00
|
|
|
|
/// opposite directions will cancel each other out, resulting in no direction.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="direction">Direction to toggle.</param>
|
2020-06-24 02:21:20 +02:00
|
|
|
|
/// <param name="subTick"></param>
|
2020-01-08 15:17:00 -08:00
|
|
|
|
/// <param name="enabled">If the direction is active.</param>
|
2020-06-24 02:21:20 +02:00
|
|
|
|
void SetVelocityDirection(Direction direction, ushort subTick, bool enabled);
|
|
|
|
|
|
|
2020-06-24 04:04:43 +02:00
|
|
|
|
void SetSprinting(ushort subTick, bool walking);
|
2019-04-04 16:18:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|