shuffling

This commit is contained in:
Chris Forbes
2010-01-02 12:22:34 +13:00
parent acacd99a71
commit a2a00ae599
17 changed files with 34 additions and 36 deletions

View File

@@ -0,0 +1,37 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
namespace OpenRa.Game.Orders
{
class UnitOrderGenerator : IOrderGenerator
{
public readonly List<Actor> selection;
public UnitOrderGenerator( IEnumerable<Actor> selected )
{
selection = selected.ToList();
}
public IEnumerable<Order> Order( int2 xy, MouseInput mi )
{
foreach( var unit in selection )
{
var ret = unit.Order( xy, mi );
if( ret != null )
yield return ret;
}
}
public void Tick()
{
selection.RemoveAll(a => a.IsDead);
}
public void Render()
{
foreach( var a in selection )
Game.worldRenderer.DrawSelectionBox( a, Color.White, true );
}
}
}