Files
crystall-punk-14/Content.Shared/Movement/Components/IMoverComponent.cs

48 lines
1.8 KiB
C#
Raw Normal View History

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
{
/// <summary>
/// Movement speed (m/s) that the entity walks.
/// </summary>
float CurrentWalkSpeed { get; }
2019-04-04 16:18:43 +02:00
/// <summary>
/// Movement speed (m/s) that the entity sprints.
/// </summary>
float CurrentSprintSpeed { get; }
/// <summary>
/// Is the entity Sprinting (running)?
/// </summary>
2020-06-24 02:21:20 +02:00
bool Sprinting { get; }
2022-04-10 16:48:11 +12:00
/// <summary>
/// Can the entity currently move. Avoids having to raise move-attempt events every time a player moves.
/// Note that this value will be overridden by the action blocker system, and shouldn't just be set directly.
/// </summary>
bool CanMove { get; set; }
Angle LastGridAngle { get; set; }
/// <summary>
/// Calculated linear velocity direction of the entity.
/// </summary>
2020-06-24 02:21:20 +02:00
(Vector2 walking, Vector2 sprinting) VelocityDir { get; }
/// <summary>
/// Toggles one of the four cardinal directions. Each of the four directions are
/// composed into a single direction vector, <see cref="SharedPlayerInputMoverComponent.VelocityDir"/>. Enabling
/// 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>
/// <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);
void SetSprinting(ushort subTick, bool walking);
2019-04-04 16:18:43 +02:00
}
}