Kill Controller

This commit is contained in:
Paul Chote
2010-07-25 19:21:53 +12:00
parent e677be7908
commit 305fa03355
31 changed files with 208 additions and 234 deletions

View File

@@ -15,6 +15,7 @@ using OpenRA.Collections;
using OpenRA.Effects;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Orders;
using OpenRA.Support;
using OpenRA.Traits;
@@ -56,6 +57,25 @@ namespace OpenRA
public readonly WorldRenderer WorldRenderer;
public IOrderGenerator OrderGenerator = new UnitOrderGenerator();
public Selection Selection = new Selection();
public void CancelInputMode() { OrderGenerator = new UnitOrderGenerator(); }
public bool ToggleInputMode<T>() where T : IOrderGenerator, new()
{
if (OrderGenerator is T)
{
CancelInputMode();
return false;
}
else
{
OrderGenerator = new T();
return true;
}
}
public World(Manifest manifest, Map map)
{
Timer.Time( "----World.ctor" );