Files
crystall-punk-14/Content.Shared/Interaction/AfterInteract.cs

69 lines
2.3 KiB
C#
Raw Permalink Normal View History

Async Interface IAfterInteract() (#2735) * Async Interface * Update Content.Server/GameObjects/Components/Fluids/MopComponent.cs Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> * Changed the glassbeaker * Update Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> * Update Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> * Interaction system fix * Removed I from the interface * Changed all implementations of the interface I could find * all public void implementation fixed * All built, no errors should remain * Update Resources/Prototypes/Entities/Objects/Specific/chemistry.yml Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Server/GameObjects/Components/Portal/TeleporterComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Server/GameObjects/Components/ActionBlocking/HandcuffComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Commit based off Sloth's commentary * Removed the Rag file from the PR * Reverted sloth's commentary changes on the publcity of the function * Injector component properly implemented interface * Update Content.Server/GameObjects/Components/Fluids/MopComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Server/GameObjects/Components/Fluids/SprayComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: BlueberryShortcake <rubetskoy234@mail.ru> Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-12-17 10:45:04 +03:00
using System.Threading.Tasks;
using JetBrains.Annotations;
using Robust.Shared.Map;
2021-06-09 22:19:39 +02:00
namespace Content.Shared.Interaction
{
[PublicAPI]
public abstract class InteractEvent : HandledEntityEventArgs
{
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
2021-12-04 12:35:33 +01:00
public EntityUid User { get; }
/// <summary>
/// Entity that the user used to interact.
/// </summary>
2021-12-04 12:35:33 +01:00
public EntityUid Used { get; }
/// <summary>
/// Entity that was interacted on. This can be null if there was no target (e.g., clicking on tiles).
/// </summary>
2021-12-04 12:35:33 +01:00
public EntityUid? Target { get; }
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>
public EntityCoordinates ClickLocation { get; }
/// <summary>
/// Is the click location in range without obstructions?
/// </summary>
public bool CanReach { get; }
public InteractEvent(EntityUid user, EntityUid used, EntityUid? target,
EntityCoordinates clickLocation, bool canReach)
{
User = user;
Used = used;
Target = target;
ClickLocation = clickLocation;
CanReach = canReach;
}
}
/// <summary>
/// Raised directed on the used object when clicking on another object and no standard interaction occurred.
/// Used for low-priority interactions facilitated by the used entity.
/// </summary>
public sealed class AfterInteractEvent : InteractEvent
{
public AfterInteractEvent(EntityUid user, EntityUid used, EntityUid? target,
EntityCoordinates clickLocation, bool canReach) : base(user, used, target, clickLocation, canReach)
{ }
}
/// <summary>
/// Raised directed on the target when clicking on another object and no standard interaction occurred. Used for
/// low-priority interactions facilitated by the target entity.
/// </summary>
public sealed class AfterInteractUsingEvent : InteractEvent
{
public AfterInteractUsingEvent(EntityUid user, EntityUid used, EntityUid? target,
EntityCoordinates clickLocation, bool canReach) : base(user, used, target, clickLocation, canReach)
{ }
}
}