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:
@@ -33,7 +33,7 @@ namespace Content.Server.AI.Utility.Actions.Idle
|
||||
var robustRandom = IoCManager.Resolve<IRobustRandom>();
|
||||
var randomGrid = FindRandomGrid(robustRandom);
|
||||
float waitTime;
|
||||
if (randomGrid != GridCoordinates.InvalidGrid)
|
||||
if (randomGrid != EntityCoordinates.Invalid)
|
||||
{
|
||||
waitTime = robustRandom.Next(3, 8);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace Content.Server.AI.Utility.Actions.Idle
|
||||
};
|
||||
}
|
||||
|
||||
private GridCoordinates FindRandomGrid(IRobustRandom robustRandom)
|
||||
private EntityCoordinates FindRandomGrid(IRobustRandom robustRandom)
|
||||
{
|
||||
// Very inefficient (should weight each region by its node count) but better than the old system
|
||||
var reachableSystem = EntitySystem.Get<AiReachableSystem>();
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace Content.Server.AI.Utility.Actions.Test
|
||||
|
||||
public override void SetupOperators(Blackboard context)
|
||||
{
|
||||
var currentPosition = Owner.Transform.GridPosition;
|
||||
var nextPosition = Owner.Transform.GridPosition.Offset(new Vector2(10.0f, 0.0f));
|
||||
var currentPosition = Owner.Transform.Coordinates;
|
||||
var nextPosition = Owner.Transform.Coordinates.Offset(new Vector2(10.0f, 0.0f));
|
||||
var originalPosOp = new MoveToGridOperator(Owner, currentPosition, 0.25f);
|
||||
var newPosOp = new MoveToGridOperator(Owner, nextPosition, 0.25f);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.AI.Utility.Actions.Test
|
||||
originalPosOp
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
protected override IReadOnlyCollection<Func<float>> GetConsiderations(Blackboard context)
|
||||
{
|
||||
var considerationsManager = IoCManager.Resolve<ConsiderationsManager>();
|
||||
|
||||
Reference in New Issue
Block a user