CenterLocation.ToCPos() -> CenterPosition.ToCPos().
This commit is contained in:
@@ -177,7 +177,7 @@ namespace OpenRA.Traits
|
||||
: new CPos[] {};
|
||||
|
||||
if (cells.Length == 0)
|
||||
cells = new CPos[] { target.CenterLocation.ToCPos() };
|
||||
cells = new CPos[] { target.CenterPosition.ToCPos() };
|
||||
|
||||
return Util.ExpandFootprint(cells, true);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace OpenRA.Traits
|
||||
return cells.Select(c => c.First);
|
||||
}
|
||||
|
||||
return new[] { a.CenterLocation.ToCPos() };
|
||||
return new[] { a.CenterPosition.ToCPos() };
|
||||
}
|
||||
|
||||
public void Explore(World world, CPos center, int range)
|
||||
|
||||
@@ -518,7 +518,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
if (owner.attackOrFleeFuzzy.CanAttack)
|
||||
{
|
||||
foreach(var u in owner.units)
|
||||
owner.world.IssueOrder(new Order("AttackMove", u, false) { TargetLocation = owner.Target.CenterLocation.ToCPos() });
|
||||
owner.world.IssueOrder(new Order("AttackMove", u, false) { TargetLocation = owner.Target.CenterPosition.ToCPos() });
|
||||
// We have gathered sufficient units. Attack the nearest enemy unit.
|
||||
owner.fsm.ChangeState(new GroundUnitsAttackMoveState(), true);
|
||||
return;
|
||||
@@ -560,7 +560,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
{
|
||||
owner.world.IssueOrder(new Order("Stop", leader, false));
|
||||
foreach (var unit in owner.units.Where(a => !ownUnits.Contains(a)))
|
||||
owner.world.IssueOrder(new Order("AttackMove", unit, false) { TargetLocation = leader.CenterLocation.ToCPos() });
|
||||
owner.world.IssueOrder(new Order("AttackMove", unit, false) { TargetLocation = leader.CenterPosition.ToCPos() });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
if (IsCanceled) return NextActivity;
|
||||
if (!Target.IsValid) return NextActivity;
|
||||
|
||||
var inRange = ( Target.CenterLocation.ToCPos() - self.Location ).LengthSquared < Range * Range;
|
||||
var inRange = ( Target.CenterPosition.ToCPos() - self.Location ).LengthSquared < Range * Range;
|
||||
|
||||
if( inRange ) return this;
|
||||
if (--nextPathTime > 0) return this;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
return Util.SequenceActivities(
|
||||
new MoveAdjacentTo(Target.FromActor(rearmTarget)),
|
||||
mobile.MoveTo(rearmTarget.CenterLocation.ToCPos(), rearmTarget),
|
||||
mobile.MoveTo(rearmTarget.CenterPosition.ToCPos(), rearmTarget),
|
||||
new Rearm(self),
|
||||
new Repair(rearmTarget),
|
||||
this );
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
}
|
||||
|
||||
ps1.heuristic = PathSearch.DefaultEstimator(mobile.toCell);
|
||||
var ps2 = PathSearch.FromPoint(self.World, mobile.Info, self, mobile.toCell, target.CenterLocation.ToCPos(), true);
|
||||
var ps2 = PathSearch.FromPoint(self.World, mobile.Info, self, mobile.toCell, target.CenterPosition.ToCPos(), true);
|
||||
var ret = self.World.WorldActor.Trait<PathFinder>().FindBidiPath(ps1, ps2);
|
||||
|
||||
return Util.SequenceActivities(mobile.MoveTo(() => ret), this);
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace OpenRA.Mods.RA.Air
|
||||
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
|
||||
|
||||
if (order.OrderID == "Move")
|
||||
return new Order(order.OrderID, self, queued) { TargetLocation = target.CenterLocation.ToCPos() };
|
||||
return new Order(order.OrderID, self, queued) { TargetLocation = target.CenterPosition.ToCPos() };
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace OpenRA.Mods.RA
|
||||
if (target.IsActor)
|
||||
return Combat.WeaponValidForTarget(Weapon, target.Actor);
|
||||
else
|
||||
return Combat.WeaponValidForTarget(Weapon, world, target.CenterLocation.ToCPos());
|
||||
return Combat.WeaponValidForTarget(Weapon, world, target.CenterPosition.ToCPos());
|
||||
}
|
||||
|
||||
public bool IsReloading { get { return FireDelay > 0; } }
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace OpenRA.Mods.RA
|
||||
if (target.IsActor)
|
||||
return new Order("Attack", self, queued) { TargetActor = target.Actor };
|
||||
else
|
||||
return new Order("Attack", self, queued) { TargetLocation = target.CenterLocation.ToCPos() };
|
||||
return new Order("Attack", self, queued) { TargetLocation = target.CenterPosition.ToCPos() };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace OpenRA.Mods.RA
|
||||
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
|
||||
|
||||
if (order.OrderID == "Harvest")
|
||||
return new Order(order.OrderID, self, queued) { TargetLocation = target.CenterLocation.ToCPos() };
|
||||
return new Order(order.OrderID, self, queued) { TargetLocation = target.CenterPosition.ToCPos() };
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
if( order is BeginMinefieldOrderTargeter )
|
||||
{
|
||||
var start = target.CenterLocation.ToCPos();
|
||||
var start = target.CenterPosition.ToCPos();
|
||||
self.World.OrderGenerator = new MinefieldOrderGenerator( self, start );
|
||||
return new Order("BeginMinefield", self, false) { TargetLocation = start };
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
if (order is MoveOrderTargeter)
|
||||
{
|
||||
if (Info.OnRails) return null;
|
||||
return new Order("Move", self, queued) { TargetLocation = target.CenterLocation.ToCPos() };
|
||||
return new Order("Move", self, queued) { TargetLocation = target.CenterPosition.ToCPos() };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
public Move(Target target, int range)
|
||||
{
|
||||
this.getPath = (self,mobile) => self.World.WorldActor.Trait<PathFinder>().FindUnitPathToRange(
|
||||
mobile.toCell, target.CenterLocation.ToCPos(),
|
||||
mobile.toCell, target.CenterPosition.ToCPos(),
|
||||
range, self);
|
||||
this.destination = null;
|
||||
this.nearEnough = range;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA
|
||||
if (self.World.FrameNumber - lastAttackTime > info.NotifyInterval * 25)
|
||||
Sound.PlayNotification(self.Owner, "Speech", "BaseAttack", self.Owner.Country.Race);
|
||||
|
||||
lastAttackLocation = self.CenterLocation.ToCPos();
|
||||
lastAttackLocation = self.CenterPosition.ToCPos();
|
||||
lastAttackTime = self.World.FrameNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA
|
||||
if (self.World.FrameNumber - lastAttackTime > info.NotifyInterval * 25)
|
||||
Sound.PlayNotification(self.Owner, "Speech", "HarvesterAttack", self.Owner.Country.Race);
|
||||
|
||||
lastAttackLocation = self.CenterLocation.ToCPos();
|
||||
lastAttackLocation = self.CenterPosition.ToCPos();
|
||||
lastAttackTime = self.World.FrameNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.RA
|
||||
public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued )
|
||||
{
|
||||
if( order.OrderID == "SetRallyPoint" )
|
||||
return new Order(order.OrderID, self, false) { TargetLocation = target.CenterLocation.ToCPos() };
|
||||
return new Order(order.OrderID, self, false) { TargetLocation = target.CenterPosition.ToCPos() };
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new MoveAdjacentTo(target));
|
||||
self.QueueActivity(mobile.MoveTo(order.TargetActor.CenterLocation.ToCPos(), order.TargetActor));
|
||||
self.QueueActivity(mobile.MoveTo(order.TargetActor.CenterPosition.ToCPos(), order.TargetActor));
|
||||
self.QueueActivity(new Rearm(self));
|
||||
self.QueueActivity(new Repair(order.TargetActor));
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public virtual IEnumerable<CPos> TargetableCells( Actor self )
|
||||
{
|
||||
yield return self.CenterLocation.ToCPos();
|
||||
yield return self.CenterPosition.ToCPos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user