Files
OpenRA/OpenRa.Game/Orders/TeleportOrderGenerator.cs
2010-01-03 16:44:13 +13:00

41 lines
795 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace OpenRa.Game.Orders
{
class TeleportOrderGenerator : IOrderGenerator
{
public readonly Actor self;
public TeleportOrderGenerator(Actor self)
{
this.self = self;
}
public IEnumerable<Order> Order(int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Left)
{
Game.controller.CancelInputMode();
yield break;
}
yield return new Order("Chronoshift", self, null, xy, null);
}
public void Tick() {}
public void Render()
{
Game.worldRenderer.DrawSelectionBox(self, Color.White, true);
}
public Cursor GetCursor(int2 xy, MouseInput mi)
{
return Cursor.Chronoshift;
}
}
}