Remove TargetActor and TargetLocation from order issuing.

This commit is contained in:
Paul Chote
2017-10-15 16:45:16 +00:00
committed by reaperrr
parent 4896a90b8d
commit d967c564a2
45 changed files with 104 additions and 144 deletions

View File

@@ -11,6 +11,7 @@
using System.Collections.Generic;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Orders
{
@@ -21,7 +22,7 @@ namespace OpenRA.Mods.Common.Orders
world.CancelInputMode();
if (mi.Button == MouseButton.Left)
yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = cell, SuppressVisualFeedback = true };
yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, Target.FromCell(world, cell), false) { SuppressVisualFeedback = true };
}
public virtual void Tick(World world) { }

View File

@@ -13,6 +13,7 @@ using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Orders;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Orders
{
@@ -35,7 +36,7 @@ namespace OpenRA.Mods.Common.Orders
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
foreach (var subject in Subjects)
if (subject != target)
yield return new Order(OrderName, subject, queued) { TargetActor = target };
yield return new Order(OrderName, subject, Target.FromActor(target), queued);
}
public override void Tick(World world)

View File

@@ -133,11 +133,13 @@ namespace OpenRA.Mods.Common.Orders
orderType = "LineBuild";
}
yield return new Order(orderType, owner.PlayerActor, false)
yield return new Order(orderType, owner.PlayerActor, Target.FromCell(world, topLeft), false)
{
TargetLocation = topLeft,
TargetActor = queue.Actor,
// Building to place
TargetString = building,
// Actor to associate the placement with
ExtraData = queue.Actor.ActorID,
SuppressVisualFeedback = true
};
}
@@ -267,9 +269,8 @@ namespace OpenRA.Mods.Common.Orders
if (availableCells.Count == 0)
continue;
yield return new Order("Move", blocker.Actor, false)
yield return new Order("Move", blocker.Actor, Target.FromCell(world, blocker.Actor.ClosestCell(availableCells)), false)
{
TargetLocation = blocker.Actor.ClosestCell(availableCells),
SuppressVisualFeedback = true
};
}

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Orders
// Repair a building.
if (underCursor.Info.HasTraitInfo<RepairableBuildingInfo>())
yield return new Order("RepairBuilding", world.LocalPlayer.PlayerActor, false) { TargetActor = underCursor };
yield return new Order("RepairBuilding", world.LocalPlayer.PlayerActor, Target.FromActor(underCursor), false);
// Don't command allied units
if (underCursor.Owner != world.LocalPlayer)
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Orders
if (repairBuilding == null)
yield break;
yield return new Order(orderId, underCursor, false) { TargetActor = repairBuilding, VisualFeedbackTarget = underCursor };
yield return new Order(orderId, underCursor, Target.FromActor(repairBuilding), false) { VisualFeedbackTarget = underCursor };
}
public void Tick(World world)