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:
@@ -47,7 +47,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
|
||||
public class ExplosionEventArgs : EventArgs
|
||||
{
|
||||
public GridCoordinates Source { get; set; }
|
||||
public EntityCoordinates Source { get; set; }
|
||||
public IEntity Target { get; set; }
|
||||
public ExplosionSeverity Severity { get; set; }
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
owner.Delete();
|
||||
}
|
||||
|
||||
public void HandleExplosion(GridCoordinates source, IEntity target, ExplosionSeverity severity)
|
||||
public void HandleExplosion(EntityCoordinates source, IEntity target, ExplosionSeverity severity)
|
||||
{
|
||||
var eventArgs = new ExplosionEventArgs
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
/// <summary>
|
||||
/// Position to start building.
|
||||
/// </summary>
|
||||
public readonly GridCoordinates Location;
|
||||
public readonly EntityCoordinates Location;
|
||||
|
||||
/// <summary>
|
||||
/// The construction prototype to start building.
|
||||
@@ -36,7 +36,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
/// </summary>
|
||||
public readonly int Ack;
|
||||
|
||||
public TryStartStructureConstructionMessage(GridCoordinates loc, string prototypeName, Angle angle, int ack)
|
||||
public TryStartStructureConstructionMessage(EntityCoordinates loc, string prototypeName, Angle angle, int ack)
|
||||
{
|
||||
Location = loc;
|
||||
PrototypeName = prototypeName;
|
||||
|
||||
@@ -5,7 +5,6 @@ using Content.Shared.Physics;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.Interfaces.Physics;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
@@ -21,7 +20,6 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
public class SharedInteractionSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
public const float InteractionRange = 2;
|
||||
public const float InteractionRangeSquared = InteractionRange * InteractionRange;
|
||||
@@ -284,7 +282,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
/// </returns>
|
||||
public bool InRangeUnobstructed(
|
||||
IEntity origin,
|
||||
GridCoordinates other,
|
||||
EntityCoordinates other,
|
||||
float range = InteractionRange,
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
Ignored predicate = null,
|
||||
@@ -292,7 +290,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
bool popup = false)
|
||||
{
|
||||
var originPosition = origin.Transform.MapPosition;
|
||||
var otherPosition = other.ToMap(_mapManager);
|
||||
var otherPosition = other.ToMap(EntityManager);
|
||||
predicate ??= e => e == origin;
|
||||
|
||||
var inRange = InRangeUnobstructed(originPosition, otherPosition, range, collisionMask, predicate, ignoreInsideBlocker);
|
||||
@@ -522,7 +520,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
|
||||
if (target == null)
|
||||
{
|
||||
otherPosition = args.ClickLocation.ToMap(_mapManager);
|
||||
otherPosition = args.ClickLocation.ToMap(EntityManager);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ using Content.Shared.GameObjects.Components.Movement;
|
||||
using Content.Shared.Physics;
|
||||
using Content.Shared.Physics.Pull;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Input;
|
||||
@@ -58,7 +57,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
collidable.EnsureController<MoverController>();
|
||||
|
||||
var weightless = !transform.Owner.HasComponent<MovementIgnoreGravityComponent>() &&
|
||||
_physicsManager.IsWeightless(transform.GridPosition);
|
||||
_physicsManager.IsWeightless(transform.Coordinates);
|
||||
|
||||
if (weightless)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user