Replace every usage of GridCoordinates with EntityCoordinates (#2021)
* Update RobustToolbox * Transition direct type usages * More updates * Fix invalid use of to map * Update RobustToolbox * Fix dropping items * Rename name usages of "GridCoordinates" to "EntityCoordinates" * Revert "Update RobustToolbox" This reverts commit 9f334a17c5908ded0043a63158bb671e4aa3f346. * Revert "Update RobustToolbox" This reverts commit 3a9c8cfa3606fa501aa84407796d2ad920853a09. # Conflicts: # RobustToolbox * Fix cursed IMapGrid method usage. * GridTileLookupTest now uses EntityCoordinates Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
public class AfterInteractEventArgs : EventArgs
|
||||
{
|
||||
public IEntity User { get; set; }
|
||||
public GridCoordinates ClickLocation { get; set; }
|
||||
public EntityCoordinates ClickLocation { get; set; }
|
||||
public IEntity Target { get; set; }
|
||||
public bool CanReach { get; set; }
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
/// <summary>
|
||||
/// Location that the user clicked outside of their interaction range.
|
||||
/// </summary>
|
||||
public GridCoordinates ClickLocation { get; }
|
||||
public EntityCoordinates ClickLocation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Is the click location close enough to reach by the player? This does not check for obstructions, just that the target is within
|
||||
@@ -63,7 +63,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
/// </summary>
|
||||
public bool CanReach { get; }
|
||||
|
||||
public AfterInteractMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation, bool canReach)
|
||||
public AfterInteractMessage(IEntity user, IEntity itemInHand, IEntity attacked, EntityCoordinates clickLocation, bool canReach)
|
||||
{
|
||||
User = user;
|
||||
Attacked = attacked;
|
||||
|
||||
@@ -20,20 +20,19 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
|
||||
public class AttackEventArgs : EventArgs
|
||||
{
|
||||
public AttackEventArgs(IEntity user, GridCoordinates clickLocation, bool wideAttack, EntityUid target = default)
|
||||
public AttackEventArgs(IEntity user, EntityCoordinates clickLocation, bool wideAttack, EntityUid target = default)
|
||||
{
|
||||
User = user;
|
||||
ClickLocation = clickLocation;
|
||||
WideAttack = wideAttack;
|
||||
Target = target;
|
||||
|
||||
IEntity? targetEntity = null;
|
||||
IoCManager.Resolve<IEntityManager>()?.TryGetEntity(Target, out targetEntity);
|
||||
IoCManager.Resolve<IEntityManager>().TryGetEntity(Target, out var targetEntity);
|
||||
TargetEntity = targetEntity;
|
||||
}
|
||||
|
||||
public IEntity User { get; }
|
||||
public GridCoordinates ClickLocation { get; }
|
||||
public EntityCoordinates ClickLocation { get; }
|
||||
public bool WideAttack { get; }
|
||||
public EntityUid Target { get; }
|
||||
public IEntity? TargetEntity { get; }
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
/// <param name="dropLocation">The location where <see cref="dropped"/> is being dropped.</param>
|
||||
/// <param name="dropped">The entity that is being dragged and dropped.</param>
|
||||
/// <param name="target">The entity that <see cref="dropped"/> is being dropped onto.</param>
|
||||
public DragDropEventArgs(IEntity user, GridCoordinates dropLocation, IEntity dropped, IEntity target)
|
||||
public DragDropEventArgs(IEntity user, EntityCoordinates dropLocation, IEntity dropped, IEntity target)
|
||||
{
|
||||
User = user;
|
||||
DropLocation = dropLocation;
|
||||
@@ -58,7 +58,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
/// <summary>
|
||||
/// The location where <see cref="Dropped"/> is being dropped.
|
||||
/// </summary>
|
||||
public GridCoordinates DropLocation { get; }
|
||||
public EntityCoordinates DropLocation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The entity that is being dragged and dropped.
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
public class InteractUsingEventArgs : EventArgs, ITargetedInteractEventArgs
|
||||
{
|
||||
public IEntity User { get; set; }
|
||||
public GridCoordinates ClickLocation { get; set; }
|
||||
public EntityCoordinates ClickLocation { get; set; }
|
||||
public IEntity Using { get; set; }
|
||||
public IEntity Target { get; set; }
|
||||
}
|
||||
@@ -63,9 +63,9 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
/// <summary>
|
||||
/// The original location that was clicked by the user.
|
||||
/// </summary>
|
||||
public GridCoordinates ClickLocation { get; }
|
||||
public EntityCoordinates ClickLocation { get; }
|
||||
|
||||
public InteractUsingMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation)
|
||||
public InteractUsingMessage(IEntity user, IEntity itemInHand, IEntity attacked, EntityCoordinates clickLocation)
|
||||
{
|
||||
User = user;
|
||||
ItemInHand = itemInHand;
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
|
||||
public class LandEventArgs : EventArgs
|
||||
{
|
||||
public LandEventArgs(IEntity user, GridCoordinates landingLocation)
|
||||
public LandEventArgs(IEntity user, EntityCoordinates landingLocation)
|
||||
{
|
||||
User = user;
|
||||
LandingLocation = landingLocation;
|
||||
}
|
||||
|
||||
public IEntity User { get; }
|
||||
public GridCoordinates LandingLocation { get; }
|
||||
public EntityCoordinates LandingLocation { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -50,9 +50,9 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
/// <summary>
|
||||
/// Location where the item landed.
|
||||
/// </summary>
|
||||
public GridCoordinates LandLocation { get; }
|
||||
public EntityCoordinates LandLocation { get; }
|
||||
|
||||
public LandMessage(IEntity user, IEntity thrown, GridCoordinates landLocation)
|
||||
public LandMessage(IEntity user, IEntity thrown, EntityCoordinates landLocation)
|
||||
{
|
||||
User = user;
|
||||
Thrown = thrown;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
{
|
||||
public IEntity User { get; set; }
|
||||
public IEntity Using { get; set; }
|
||||
public GridCoordinates ClickLocation { get; set; }
|
||||
public EntityCoordinates ClickLocation { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -56,9 +56,9 @@ namespace Content.Shared.Interfaces.GameObjects.Components
|
||||
/// <summary>
|
||||
/// Location that the user clicked outside of their interaction range.
|
||||
/// </summary>
|
||||
public GridCoordinates ClickLocation { get; }
|
||||
public EntityCoordinates ClickLocation { get; }
|
||||
|
||||
public RangedInteractMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation)
|
||||
public RangedInteractMessage(IEntity user, IEntity itemInHand, IEntity attacked, EntityCoordinates clickLocation)
|
||||
{
|
||||
User = user;
|
||||
ItemInHand = itemInHand;
|
||||
|
||||
Reference in New Issue
Block a user