2023-12-25 18:34:21 +11:00
|
|
|
using Content.Shared.Movement.Components;
|
|
|
|
|
using Content.Shared.Movement.Systems;
|
|
|
|
|
|
2022-07-16 13:51:52 +10:00
|
|
|
namespace Content.Shared.Movement.Events;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-12-25 18:34:21 +11:00
|
|
|
/// Raised on an entity whenever it has a movement input change.
|
2022-07-16 13:51:52 +10:00
|
|
|
/// </summary>
|
|
|
|
|
[ByRefEvent]
|
|
|
|
|
public readonly struct MoveInputEvent
|
|
|
|
|
{
|
2024-08-01 18:32:32 -07:00
|
|
|
public readonly Entity<InputMoverComponent> Entity;
|
2023-12-25 18:34:21 +11:00
|
|
|
public readonly MoveButtons OldMovement;
|
2022-07-16 13:51:52 +10:00
|
|
|
|
2024-08-01 18:32:32 -07:00
|
|
|
public bool HasDirectionalMovement => (Entity.Comp.HeldMoveButtons & MoveButtons.AnyDirection) != MoveButtons.None;
|
2024-02-02 21:14:20 -05:00
|
|
|
|
2024-08-01 18:32:32 -07:00
|
|
|
public MoveInputEvent(Entity<InputMoverComponent> entity, MoveButtons oldMovement)
|
2022-07-16 13:51:52 +10:00
|
|
|
{
|
|
|
|
|
Entity = entity;
|
2023-12-25 18:34:21 +11:00
|
|
|
OldMovement = oldMovement;
|
2022-07-16 13:51:52 +10:00
|
|
|
}
|
|
|
|
|
}
|