Add target param to INotifyAttack. Remove target field from AttackOmni

This commit is contained in:
Bob
2010-11-14 16:03:01 +13:00
parent f8e6245903
commit e7a07ea9c3
10 changed files with 10 additions and 17 deletions

View File

@@ -22,7 +22,6 @@ namespace OpenRA.Mods.RA
class AttackOmni : AttackBase, INotifyBuildComplete
{
bool buildComplete = false;
protected Target target;
public void BuildingComplete(Actor self) { buildComplete = true; }
public AttackOmni(Actor self) : base(self) { }
@@ -33,12 +32,6 @@ namespace OpenRA.Mods.RA
return base.CanAttack( self, target ) && !isBuilding;
}
public override void Tick(Actor self)
{
base.Tick(self);
DoAttack(self, target);
}
protected override IActivity GetAttackActivity(Actor self, Target newTarget, bool allowMove)
{
return new SetTarget( newTarget );
@@ -54,7 +47,7 @@ namespace OpenRA.Mods.RA
if( IsCanceled || !target.IsValid )
return NextActivity;
self.Trait<AttackOmni>().target = target;
self.Trait<AttackOmni>().DoAttack(self, target);
return this;
}
}