Add native support for uninterruptible activities
This pattern occurs a few times throughout the code, so it makes sense to bake it into the Activity class itself.
This commit is contained in:
@@ -19,22 +19,15 @@ namespace OpenRA.Activities
|
||||
public CallFunc(Action a, bool interruptable)
|
||||
{
|
||||
this.a = a;
|
||||
this.interruptable = interruptable;
|
||||
IsInterruptible = interruptable;
|
||||
}
|
||||
|
||||
Action a;
|
||||
bool interruptable;
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (a != null) a();
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
public override void Cancel(Actor self)
|
||||
{
|
||||
if (interruptable)
|
||||
base.Cancel(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user