Add default for Activity-Tick

This commit is contained in:
tovl
2019-05-12 18:08:22 +02:00
committed by teinarss
parent b9c302a73a
commit 714b09ac4f
3 changed files with 7 additions and 18 deletions

View File

@@ -82,7 +82,13 @@ namespace OpenRA.Activities
return ret;
}
public abstract Activity Tick(Actor self);
/// <summary>
/// Runs every timestep as long as this activity is active.
/// </summary>
public virtual Activity Tick(Actor self)
{
return NextActivity;
}
/// <summary>
/// Runs once immediately before the first Tick() execution.

View File

@@ -50,12 +50,6 @@ namespace OpenRA.Mods.Common.Activities
QueueChild(new TakeOff(self));
}
public override Activity Tick(Actor self)
{
return NextActivity;
}
class ReleaseUnit : Activity
{
readonly Carryall carryall;
@@ -98,11 +92,6 @@ namespace OpenRA.Mods.Common.Activities
carryable.Detached(cargo);
});
}
public override Activity Tick(Actor self)
{
return NextActivity;
}
}
}
}

View File

@@ -168,11 +168,5 @@ namespace OpenRA.Mods.Common.Activities
{
return new Order(orderString, newActor, target, true);
}
public override Activity Tick(Actor self)
{
// Activity is a placeholder that should never run
return NextActivity;
}
}
}