another ctor removed

This commit is contained in:
Chris Forbes
2010-11-23 15:20:11 +13:00
parent 490b0801a0
commit 23e6eada26
12 changed files with 17 additions and 17 deletions

View File

@@ -60,8 +60,6 @@ namespace OpenRA
public Order(string orderString, Actor subject, bool queued) public Order(string orderString, Actor subject, bool queued)
: this(orderString, subject, null, int2.Zero, null, queued, int2.Zero) { } : this(orderString, subject, null, int2.Zero, null, queued, int2.Zero) { }
public Order(string orderString, Actor subject, int2 targetLocation, bool queued)
: this(orderString, subject, null, targetLocation, null, queued, int2.Zero) { }
public Order(string orderString, Actor subject, string targetString, bool queued) public Order(string orderString, Actor subject, string targetString, bool queued)
: this(orderString, subject, null, int2.Zero, targetString, queued, int2.Zero) { } : this(orderString, subject, null, int2.Zero, targetString, queued, int2.Zero) { }
public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation, bool queued) public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation, bool queued)

View File

@@ -61,7 +61,7 @@ namespace OpenRA.Orders
{ {
world.CancelInputMode(); world.CancelInputMode();
foreach (var subject in subjects) foreach (var subject in subjects)
yield return new Order(order, subject, xy, false); yield return new Order(order, subject, false) { TargetLocation = xy };
} }
} }

View File

@@ -139,7 +139,7 @@ namespace OpenRA.Widgets.Delegates
var nextStance = GetNextStance((Stance)Enum.Parse(typeof(Stance), bw.Text)); var nextStance = GetNextStance((Stance)Enum.Parse(typeof(Stance), bw.Text));
world.IssueOrder(new Order("SetStance", world.LocalPlayer.PlayerActor, world.IssueOrder(new Order("SetStance", world.LocalPlayer.PlayerActor,
new int2(p.Index, (int)nextStance), false)); false) { TargetLocation = new int2(p.Index, (int)nextStance) });
bw.Text = nextStance.ToString(); bw.Text = nextStance.ToString();
} }

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Air
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor }; return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
if( order.OrderID == "Move" ) if( order.OrderID == "Move" )
return new Order( order.OrderID, self, Util.CellContaining( target.CenterLocation ), queued ); return new Order(order.OrderID, self, queued) { TargetLocation = Util.CellContaining(target.CenterLocation) };
return null; return null;
} }

View File

@@ -66,7 +66,7 @@ namespace OpenRA.Mods.RA.Air
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor }; return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
if( order.OrderID == "Move" ) if( order.OrderID == "Move" )
return new Order( order.OrderID, self, Util.CellContaining( target.CenterLocation ), queued ); return new Order( order.OrderID, self, queued ) { TargetLocation = Util.CellContaining( target.CenterLocation ) };
return null; return null;
} }

View File

@@ -140,7 +140,7 @@ namespace OpenRA.Mods.RA
if( target.IsActor ) if( target.IsActor )
return new Order("Attack", self, queued) { TargetActor = target.Actor }; return new Order("Attack", self, queued) { TargetActor = target.Actor };
else else
return new Order( "Attack", self, Util.CellContaining( target.CenterLocation ), queued ); return new Order( "Attack", self, queued ) { TargetLocation = Util.CellContaining( target.CenterLocation ) };
} }
return null; return null;
} }

View File

@@ -302,7 +302,7 @@ namespace OpenRA.Mods.RA
int2 newRallyPoint = ChooseRallyLocationNear(a.Location); int2 newRallyPoint = ChooseRallyLocationNear(a.Location);
newRallyPoint.X += 4; newRallyPoint.X += 4;
newRallyPoint.Y += 4; newRallyPoint.Y += 4;
world.IssueOrder(new Order("SetRallyPoint", a, newRallyPoint, false)); world.IssueOrder(new Order("SetRallyPoint", a, false) { TargetLocation = newRallyPoint });
} }
} }
@@ -335,7 +335,7 @@ namespace OpenRA.Mods.RA
range = Math.Max(range, loopCount / 2); range = Math.Max(range, loopCount / 2);
if (loopCount > 10) return false; if (loopCount > 10) return false;
} while (!a.Trait<IMove>().CanEnterCell(xy) && xy != a.Location); } while (!a.Trait<IMove>().CanEnterCell(xy) && xy != a.Location);
world.IssueOrder(new Order("Move", a, xy, false)); world.IssueOrder(new Order("Move", a, false) { TargetLocation = xy });
return true; return true;
} }
@@ -357,7 +357,7 @@ namespace OpenRA.Mods.RA
range = Math.Max(range, loopCount / 2); range = Math.Max(range, loopCount / 2);
if (loopCount > 10) return false; if (loopCount > 10) return false;
} while (!a.Trait<IMove>().CanEnterCell(xy) && xy != a.Location); } while (!a.Trait<IMove>().CanEnterCell(xy) && xy != a.Location);
world.IssueOrder(new Order("AttackMove", a, xy, false)); world.IssueOrder(new Order("AttackMove", a, false) { TargetLocation = xy });
return true; return true;
} }

View File

@@ -109,7 +109,7 @@ namespace OpenRA.Mods.RA
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor }; return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
if( order.OrderID == "Harvest" ) if( order.OrderID == "Harvest" )
return new Order( order.OrderID, self, Util.CellContaining( target.CenterLocation ), queued ); return new Order(order.OrderID, self, queued) { TargetLocation = Util.CellContaining(target.CenterLocation) };
return null; return null;
} }

View File

@@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA
{ {
var start = Traits.Util.CellContaining( target.CenterLocation ); var start = Traits.Util.CellContaining( target.CenterLocation );
self.World.OrderGenerator = new MinefieldOrderGenerator( self, start ); self.World.OrderGenerator = new MinefieldOrderGenerator( self, start );
return new Order( "BeginMinefield", self, start, false ); return new Order("BeginMinefield", self, false) { TargetLocation = start };
} }
return null; return null;
} }
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.RA
if( mi.Button == MouseButton.Right && underCursor == null ) if( mi.Button == MouseButton.Right && underCursor == null )
{ {
minelayer.World.CancelInputMode(); minelayer.World.CancelInputMode();
yield return new Order( "PlaceMinefield", minelayer, xy, false ); yield return new Order("PlaceMinefield", minelayer, false) { TargetLocation = xy };
} }
} }
@@ -127,7 +127,8 @@ namespace OpenRA.Mods.RA
return; return;
var movement = minelayer.Trait<IMove>(); var movement = minelayer.Trait<IMove>();
var minefield = GetMinefieldCells(minefieldStart, lastMousePos, minelayer.Info.Traits.Get<MinelayerInfo>().MinefieldDepth) var minefield = GetMinefieldCells(minefieldStart, lastMousePos,
minelayer.Info.Traits.Get<MinelayerInfo>().MinefieldDepth)
.Where(p => movement.CanEnterCell(p)).ToArray(); .Where(p => movement.CanEnterCell(p)).ToArray();
wr.DrawLocus(Color.Cyan, minefield); wr.DrawLocus(Color.Cyan, minefield);

View File

@@ -146,7 +146,7 @@ namespace OpenRA.Mods.RA.Move
if( order is MoveOrderTargeter ) if( order is MoveOrderTargeter )
{ {
if( Info.OnRails ) return null; if( Info.OnRails ) return null;
return new Order( "Move", self, Util.CellContaining( target.CenterLocation ), queued ); return new Order( "Move", self, queued ) { TargetLocation = Util.CellContaining( target.CenterLocation ) };
} }
return null; return null;
} }

View File

@@ -32,8 +32,9 @@ namespace OpenRA.Mods.RA.Orders
yield break; yield break;
} }
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
if (world.LocalPlayer.Shroud.IsExplored(xy)) if (world.LocalPlayer.Shroud.IsExplored(xy))
yield return new Order("ChronoshiftSelf", self, xy, mi.Modifiers.HasModifier(Modifiers.Shift)); yield return new Order("ChronoshiftSelf", self, queued) { TargetLocation = xy };
} }
public void Tick( World world ) { } public void Tick( World world ) { }

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA
public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued ) public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued )
{ {
if( order.OrderID == "SetRallyPoint" ) if( order.OrderID == "SetRallyPoint" )
return new Order( order.OrderID, self, Traits.Util.CellContaining( target.CenterLocation ), false ); return new Order(order.OrderID, self, false) { TargetLocation = Traits.Util.CellContaining(target.CenterLocation) };
return null; return null;
} }