Add World parameter to Target.FromCell.

This commit is contained in:
Paul Chote
2013-09-17 21:50:15 +12:00
parent e4ea012b9e
commit 086ec07eb6
21 changed files with 36 additions and 37 deletions

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Air
if (order.OrderString == "Move")
{
var cell = self.World.Map.Clamp(order.TargetLocation);
var t = Target.FromCell(cell);
var t = Target.FromCell(self.World, cell);
self.SetTargetLine(t, Color.Green);
self.CancelActivity();
@@ -161,8 +161,8 @@ namespace OpenRA.Mods.RA.Air
return (d * 1024 * 8) / (int)distSq;
}
public Activity MoveTo(CPos cell, int nearEnough) { return new HeliFly(self, Target.FromCell(cell)); }
public Activity MoveTo(CPos cell, Actor ignoredActor) { return new HeliFly(self, Target.FromCell(cell)); }
public Activity MoveTo(CPos cell, int nearEnough) { return new HeliFly(self, Target.FromCell(self.World, cell)); }
public Activity MoveTo(CPos cell, Actor ignoredActor) { return new HeliFly(self, Target.FromCell(self.World, cell)); }
public Activity MoveWithinRange(Target target, WRange range) { return new HeliFly(self, target, WRange.Zero, range); }
public Activity MoveWithinRange(Target target, WRange minRange, WRange maxRange) { return new HeliFly(self, target, minRange, maxRange); }
public Activity MoveFollow(Actor self, Target target, WRange minRange, WRange maxRange) { return new Follow(self, target, minRange, maxRange); }
@@ -170,7 +170,7 @@ namespace OpenRA.Mods.RA.Air
public Activity MoveIntoWorld(Actor self, CPos cell)
{
return new HeliFly(self, Target.FromCell(cell));
return new HeliFly(self, Target.FromCell(self.World, cell));
}
public Activity VisualMove(Actor self, WPos fromPos, WPos toPos)

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA.Air
UnReserve();
var cell = self.World.Map.Clamp(order.TargetLocation);
var t = Target.FromCell(cell);
var t = Target.FromCell(self.World, cell);
self.SetTargetLine(t, Color.Green);
self.CancelActivity();
self.QueueActivity(new Fly(self, t));
@@ -101,14 +101,14 @@ namespace OpenRA.Mods.RA.Air
}
}
public Activity MoveTo(CPos cell, int nearEnough) { return Util.SequenceActivities(new Fly(self, Target.FromCell(cell)), new FlyCircle()); }
public Activity MoveTo(CPos cell, Actor ignoredActor) { return Util.SequenceActivities(new Fly(self, Target.FromCell(cell)), new FlyCircle()); }
public Activity MoveTo(CPos cell, int nearEnough) { return Util.SequenceActivities(new Fly(self, Target.FromCell(self.World, cell)), new FlyCircle()); }
public Activity MoveTo(CPos cell, Actor ignoredActor) { return Util.SequenceActivities(new Fly(self, Target.FromCell(self.World, cell)), new FlyCircle()); }
public Activity MoveWithinRange(Target target, WRange range) { return Util.SequenceActivities(new Fly(self, target, WRange.Zero, range), new FlyCircle()); }
public Activity MoveWithinRange(Target target, WRange minRange, WRange maxRange) { return Util.SequenceActivities(new Fly(self, target, minRange, maxRange), new FlyCircle()); }
public Activity MoveFollow(Actor self, Target target, WRange minRange, WRange maxRange) { return new FlyFollow(self, target, minRange, maxRange); }
public CPos NearestMoveableCell(CPos cell) { return cell; }
public Activity MoveIntoWorld(Actor self, CPos cell) { return new Fly(self, Target.FromCell(cell)); }
public Activity MoveIntoWorld(Actor self, CPos cell) { return new Fly(self, Target.FromCell(self.World, cell)); }
public Activity VisualMove(Actor self, WPos fromPos, WPos toPos) { return Util.SequenceActivities(new CallFunc(() => SetVisualPosition(self, fromPos)), new Fly(self, Target.FromPos(toPos))); }
}
}