unit idle tracking via dummy activity; wasn't so bad.

This commit is contained in:
Chris Forbes
2009-12-28 08:26:13 +13:00
parent 47f4815205
commit b7bac5bd16
11 changed files with 83 additions and 48 deletions

View File

@@ -48,17 +48,23 @@ namespace OpenRa.Game
public void Tick()
{
var nextActivity = currentActivity;
while( nextActivity != null )
while (currentActivity != null)
{
currentActivity = nextActivity;
nextActivity = nextActivity.Tick( this );
var a = currentActivity;
currentActivity = a.Tick(this) ?? new Idle();
if (a == currentActivity) break;
}
foreach (var tick in traits.WithInterface<ITick>())
tick.Tick(this);
}
public bool IsIdle
{
get { return currentActivity == null || currentActivity is Idle; }
}
public float2 CenterLocation;
public float2 SelectedSize
{