Give some of the most common interaction events EntityUid properties

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 15:00:59 +01:00
parent 48f8dd2284
commit c10a65d588
8 changed files with 100 additions and 0 deletions

View File

@@ -15,16 +15,31 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public EntityUid UsedUid => Used.Uid;
/// <summary>
/// Entity that was interacted on. This can be null if the attack did not click on an entity.
/// </summary>
public IEntity? Target { get; }
/// <summary>
/// Entity that was interacted on. This can be null if the attack did not click on an entity.
/// </summary>
public EntityUid? TargetUid => Target?.Uid;
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>

View File

@@ -45,11 +45,21 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that activated the target world entity.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Entity that was activated in the world.
/// </summary>
public IEntity Target { get; }
/// <summary>
/// Entity that was activated in the world.
/// </summary>
public EntityUid TargetUid => Target.Uid;
public ActivateInWorldEvent(IEntity user, IEntity target)
{
User = user;

View File

@@ -56,16 +56,31 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public EntityUid UsedUid => Used.Uid;
/// <summary>
/// Entity that was interacted on. This can be null if the attack did not click on an entity.
/// </summary>
public IEntity? Target { get; }
/// <summary>
/// Entity that was interacted on. This can be null if the attack did not click on an entity.
/// </summary>
public EntityUid? TargetUid => Target?.Uid;
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>

View File

@@ -39,11 +39,21 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that dropped the item.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Item that was dropped.
/// </summary>
public IEntity Dropped { get; }
/// <summary>
/// Item that was dropped.
/// </summary>
public EntityUid DroppedUid => Dropped.Uid;
/// <summary>
/// If the item was dropped intentionally.
/// </summary>

View File

@@ -42,11 +42,21 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Entity that was interacted on.
/// </summary>
public IEntity Target { get; }
/// <summary>
/// Entity that was interacted on.
/// </summary>
public EntityUid TargetUid => Target.Uid;
public InteractHandEvent(IEntity user, IEntity target)
{
User = user;

View File

@@ -55,16 +55,31 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public EntityUid UsedUid => Used.Uid;
/// <summary>
/// Entity that was interacted on.
/// </summary>
public IEntity Target { get; }
/// <summary>
/// Entity that was interacted on.
/// </summary>
public EntityUid TargetUid => Target.Uid;
/// <summary>
/// The original location that was clicked by the user.
/// </summary>

View File

@@ -46,16 +46,31 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public EntityUid UsedUid => Used.Uid;
/// <summary>
/// Entity that was interacted on.
/// </summary>
public IEntity Target { get; }
/// <summary>
/// Entity that was interacted on.
/// </summary>
public EntityUid TargetUid => Target.Uid;
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>

View File

@@ -41,11 +41,21 @@ namespace Content.Shared.Interaction
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity holding the item in their hand.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary>
/// Item that was used.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Item that was used.
/// </summary>
public EntityUid UsedUid => Used.Uid;
public UseInHandEvent(IEntity user, IEntity used)
{
User = user;