using System;
using Content.Shared.Hands.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
namespace Content.Shared.Hands
{
///
/// Raised when an entity item in a hand is deselected.
///
[PublicAPI]
public sealed class HandDeselectedEvent : HandledEntityEventArgs
{
///
/// Entity that owns the deselected hand.
///
public EntityUid User { get; }
///
/// Item in the hand that was deselected.
///
public EntityUid Item { get; }
public HandDeselectedEvent(EntityUid user, EntityUid item)
{
User = user;
Item = item;
}
}
///
/// Raised when an item entity held by a hand is selected.
///
[PublicAPI]
public sealed class HandSelectedEvent : HandledEntityEventArgs
{
///
/// Entity that owns the selected hand.
///
public EntityUid User { get; }
///
/// Item in the hand that was selected.
///
public EntityUid Item { get; }
public HandSelectedEvent(EntityUid user, EntityUid item)
{
User = user;
Item = item;
}
}
[Serializable, NetSerializable]
public sealed class RequestSetHandEvent : EntityEventArgs
{
///
/// The hand to be swapped to.
///
public string HandName { get; }
public RequestSetHandEvent(string handName)
{
HandName = handName;
}
}
[Serializable, NetSerializable]
public sealed class PickupAnimationEvent : EntityEventArgs
{
public EntityUid ItemUid { get; }
public EntityCoordinates InitialPosition { get; }
public Vector2 FinalPosition { get; }
public PickupAnimationEvent(EntityUid itemUid, EntityCoordinates initialPosition,
Vector2 finalPosition)
{
ItemUid = itemUid;
FinalPosition = finalPosition;
InitialPosition = initialPosition;
}
}
///
/// Raised directed on both the blocking entity and user when
/// a virtual hand item is deleted.
///
public sealed class VirtualItemDeletedEvent : EntityEventArgs
{
public EntityUid BlockingEntity;
public EntityUid User;
public VirtualItemDeletedEvent(EntityUid blockingEntity, EntityUid user)
{
BlockingEntity = blockingEntity;
User = user;
}
}
///
/// Raised when putting an entity into a hand slot
///
[PublicAPI]
public abstract class EquippedHandEvent : HandledEntityEventArgs
{
///
/// Entity that equipped the item.
///
public EntityUid User { get; }
///
/// Item that was equipped.
///
public EntityUid Equipped { get; }
///
/// Hand that the item was placed into.
///
public Hand Hand { get; }
public EquippedHandEvent(EntityUid user, EntityUid equipped, Hand hand)
{
User = user;
Equipped = equipped;
Hand = hand;
}
}
///
/// Raised when removing an entity from an inventory slot.
///
[PublicAPI]
public abstract class UnequippedHandEvent : HandledEntityEventArgs
{
///
/// Entity that equipped the item.
///
public EntityUid User { get; }
///
/// Item that was unequipped.
///
public EntityUid Unequipped { get; }
///
/// Hand that the item is removed from.
///
public Hand Hand { get; }
public UnequippedHandEvent(EntityUid user, EntityUid unequipped, Hand hand)
{
User = user;
Unequipped = unequipped;
Hand = hand;
}
}
public sealed class GotEquippedHandEvent : EquippedHandEvent
{
public GotEquippedHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
}
public sealed class GotUnequippedHandEvent : UnequippedHandEvent
{
public GotUnequippedHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
}
public sealed class DidEquipHandEvent : EquippedHandEvent
{
public DidEquipHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
}
public sealed class DidUnequipHandEvent : UnequippedHandEvent
{
public DidUnequipHandEvent(EntityUid user, EntityUid unequipped, Hand hand) : base(user, unequipped, hand) { }
}
}