Make INotifyIdle and INotifyBecomingIdle require explicit implementation

This commit is contained in:
reaperrr
2017-09-07 17:39:47 +02:00
committed by Matthias Mailänder
parent ddfed13db4
commit 761a4f29ab
7 changed files with 20 additions and 7 deletions

View File

@@ -57,12 +57,17 @@ namespace OpenRA.Mods.Common.Traits
base.Created(self);
}
public virtual void OnBecomingIdle(Actor self)
protected virtual void OnBecomingIdle(Actor self)
{
countdown = self.World.SharedRandom.Next(info.MinMoveDelay, info.MaxMoveDelay);
}
public virtual void TickIdle(Actor self)
void INotifyBecomingIdle.OnBecomingIdle(Actor self)
{
OnBecomingIdle(self);
}
protected virtual void TickIdle(Actor self)
{
if (IsTraitDisabled)
return;
@@ -83,6 +88,11 @@ namespace OpenRA.Mods.Common.Traits
DoAction(self, targetCell);
}
void INotifyIdle.TickIdle(Actor self)
{
TickIdle(self);
}
CPos PickTargetLocation()
{
var target = self.CenterPosition + new WVec(0, -1024 * effectiveMoveRadius, 0).Rotate(WRot.FromFacing(self.World.SharedRandom.Next(255)));