Trait-based units. Any unit/building without sequences will cause a crash when built.

This commit is contained in:
Bob
2009-10-10 00:31:16 +13:00
parent a08bcd9a17
commit 3181b055aa
18 changed files with 1377 additions and 1182 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenRa.Game
{
class UnitOrderGenerator : IOrderGenerator
{
public readonly List<Actor> selection;
public UnitOrderGenerator( IEnumerable<Actor> selected )
{
selection = selected.ToList();
}
public IEnumerable<Order> Order( Game game, int2 xy )
{
foreach( var unit in selection )
{
var ret = unit.Order( game, xy );
if( ret != null )
yield return ret;
}
//if( ( fromCell == toCell || moveFraction == 0 ) && fromCell == xy )
//{
// if( SupportsMission( SupportedMissions.Deploy ) )
// return new DeployMcvOrder( this );
// if( SupportsMission( SupportedMissions.Harvest ) )
// return new HarvestOrder( this );
//}
//return new MoveOrder( this, xy );
}
public void PrepareOverlay( Game game, int2 xy ) { }
}
}