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:
DrSmugleaf
2020-09-06 16:11:53 +02:00
committed by GitHub
parent 72d2318ea7
commit 48b61f6bcc
196 changed files with 780 additions and 676 deletions

View File

@@ -3,7 +3,7 @@ using System;
using Content.Shared.GameObjects.EntitySystems;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
@@ -22,7 +22,7 @@ namespace Content.Shared.Physics.Pull
public bool GettingPulled => _puller != null;
private GridCoordinates? _movingTo;
private EntityCoordinates? _movingTo;
public ICollidableComponent? Puller => _puller;
@@ -76,23 +76,23 @@ namespace Content.Shared.Physics.Pull
ControlledComponent.TryRemoveController<PullController>();
}
public void TryMoveTo(GridCoordinates from, GridCoordinates to)
public void TryMoveTo(EntityCoordinates from, EntityCoordinates to)
{
if (_puller == null || ControlledComponent == null)
{
return;
}
var mapManager = IoCManager.Resolve<IMapManager>();
var entityManager = IoCManager.Resolve<IEntityManager>();
if (!from.InRange(mapManager, to, SharedInteractionSystem.InteractionRange))
if (!from.InRange(entityManager, to, SharedInteractionSystem.InteractionRange))
{
return;
}
ControlledComponent.WakeBody();
var dist = _puller.Owner.Transform.GridPosition.Position - to.Position;
var dist = _puller.Owner.Transform.Coordinates.Position - to.Position;
if (Math.Sqrt(dist.LengthSquared) > DistBeforeStopPull ||
Math.Sqrt(dist.LengthSquared) < 0.25f)
@@ -125,7 +125,7 @@ namespace Content.Shared.Physics.Pull
}
else if (_movingTo.HasValue)
{
var diff = _movingTo.Value.Position - ControlledComponent.Owner.Transform.GridPosition.Position;
var diff = _movingTo.Value.Position - ControlledComponent.Owner.Transform.Coordinates.Position;
LinearVelocity = diff.Normalized * 5;
}
else if (dist.Length > DistBeforePull)
@@ -153,7 +153,7 @@ namespace Content.Shared.Physics.Pull
return;
}
if (ControlledComponent.Owner.Transform.GridPosition.Position.EqualsApprox(_movingTo.Value.Position, 0.01))
if (ControlledComponent.Owner.Transform.Coordinates.Position.EqualsApprox(_movingTo.Value.Position, 0.01))
{
_movingTo = null;
}