move CancelableActivity into its own file
This commit is contained in:
@@ -180,37 +180,6 @@ namespace OpenRA.Traits
|
||||
IEnumerable<float2> GetCurrentPath();
|
||||
}
|
||||
|
||||
public abstract class CancelableActivity : IActivity
|
||||
{
|
||||
protected IActivity NextActivity { get; private set; }
|
||||
protected bool IsCanceled { get; private set; }
|
||||
|
||||
public abstract IActivity Tick( Actor self );
|
||||
protected virtual bool OnCancel( Actor self ) { return true; }
|
||||
|
||||
public void Cancel( Actor self )
|
||||
{
|
||||
IsCanceled = OnCancel( self );
|
||||
if( IsCanceled )
|
||||
NextActivity = null;
|
||||
else if (NextActivity != null)
|
||||
NextActivity.Cancel( self );
|
||||
}
|
||||
|
||||
public void Queue( IActivity activity )
|
||||
{
|
||||
if( NextActivity != null )
|
||||
NextActivity.Queue( activity );
|
||||
else
|
||||
NextActivity = activity;
|
||||
}
|
||||
|
||||
public virtual IEnumerable<float2> GetCurrentPath()
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IRenderOverlay { void Render( WorldRenderer wr ); }
|
||||
public interface INotifyIdle { void Idle(Actor self); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user