Ditto for OrderGenerators.

This commit is contained in:
Bob
2010-01-21 13:37:45 +13:00
parent 4fa56f16c0
commit 6ac384669b
13 changed files with 90 additions and 90 deletions

View File

@@ -9,21 +9,21 @@ namespace OpenRa.Orders
{
class PowerDownOrderGenerator : IOrderGenerator
{
public IEnumerable<Order> Order(int2 xy, MouseInput mi)
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
Game.controller.CancelInputMode();
return OrderInner(xy, mi);
return OrderInner(world, xy, mi);
}
IEnumerable<Order> OrderInner(int2 xy, MouseInput mi)
IEnumerable<Order> OrderInner(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Left)
{
var loc = mi.Location + Game.viewport.Location;
var underCursor = Game.world.FindUnits(loc, loc)
.Where(a => a.Owner == Game.world.LocalPlayer
var underCursor = world.FindUnits(loc, loc)
.Where(a => a.Owner == world.LocalPlayer
&& a.traits.Contains<Building>()
&& a.traits.Contains<Selectable>()).FirstOrDefault();
@@ -32,13 +32,13 @@ namespace OpenRa.Orders
}
}
public void Tick() { }
public void Render() { }
public void Tick( World world ) { }
public void Render( World world ) { }
public Cursor GetCursor(int2 xy, MouseInput mi)
public Cursor GetCursor(World world, int2 xy, MouseInput mi)
{
mi.Button = MouseButton.Left;
return OrderInner(xy, mi).Any()
return OrderInner(world, xy, mi).Any()
? Cursor.PowerDown : Cursor.PowerDown;
}
}