Move CancelableActivity into the Activities namespace. Remove the Idle activity.

This commit is contained in:
Paul Chote
2010-11-30 11:11:14 +13:00
parent e97dd2ee47
commit 5070a81db4
30 changed files with 32 additions and 27 deletions

View File

@@ -68,10 +68,7 @@ namespace OpenRA
public void Tick()
{
if (currentActivity == null)
currentActivity = new Idle();
if (currentActivity is Idle)
if (currentActivity == null)
foreach (var ni in TraitsImplementing<INotifyIdle>())
ni.TickIdle(this);
@@ -80,7 +77,7 @@ namespace OpenRA
public bool IsIdle
{
get { return currentActivity is Idle; }
get { return currentActivity == null; }
}
OpenRA.FileFormats.Lazy<float2> Size;
@@ -121,7 +118,7 @@ namespace OpenRA
public void QueueActivity( IActivity nextActivity )
{
if( currentActivity is Idle )
if( currentActivity == null )
currentActivity = nextActivity;
else
currentActivity.Queue( nextActivity );
@@ -129,7 +126,7 @@ namespace OpenRA
public void CancelActivity()
{
if( !(currentActivity is Idle) )
if( currentActivity != null )
currentActivity.Cancel( this );
}