Make Attack*Info plumbing consistent.

This commit is contained in:
Paul Chote
2014-03-08 12:24:02 +13:00
parent 116e4acda3
commit 113bfe5311
7 changed files with 13 additions and 13 deletions

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA
Lazy<IEnumerable<Armament>> armaments;
protected IEnumerable<Armament> Armaments { get { return armaments.Value; } }
public AttackBase(Actor self)
public AttackBase(Actor self, AttackBaseInfo info)
{
this.self = self;
armaments = Lazy.New(() => self.TraitsImplementing<Armament>());

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA
public readonly int InitialChargeDelay = 22;
[Desc("Delay for additional charges if MaxCharge is larger than 1.")]
public readonly int ChargeDelay = 3;
public override object Create(ActorInitializer init) { return new AttackCharge(init.self); }
public override object Create(ActorInitializer init) { return new AttackCharge(init.self, this); }
}
class AttackCharge : AttackOmni, ITick, INotifyAttack, ISync
@@ -34,8 +34,8 @@ namespace OpenRA.Mods.RA
[Sync] int charges;
[Sync] int timeToRecharge;
public AttackCharge(Actor self)
: base(self)
public AttackCharge(Actor self, AttackChargeInfo info)
: base(self, info)
{
aci = self.Info.Traits.Get<AttackChargeInfo>();
charges = aci.MaxCharges;

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA
readonly AttackFrontalInfo info;
public AttackFrontal(Actor self, AttackFrontalInfo info)
: base(self)
: base(self, info)
{
this.info = info;
}

View File

@@ -15,7 +15,7 @@ namespace OpenRA.Mods.RA
{
class AttackOmniInfo : AttackBaseInfo
{
public override object Create(ActorInitializer init) { return new AttackOmni(init.self); }
public override object Create(ActorInitializer init) { return new AttackOmni(init.self, this); }
}
class AttackOmni : AttackBase, INotifyBuildComplete, ISync
@@ -23,8 +23,8 @@ namespace OpenRA.Mods.RA
[Sync] bool buildComplete = false;
public void BuildingComplete(Actor self) { buildComplete = true; }
public AttackOmni(Actor self)
: base(self) { }
public AttackOmni(Actor self, AttackOmniInfo info)
: base(self, info) { }
protected override bool CanAttack(Actor self, Target target)
{

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
Turreted turret;
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info)
: base(init.self)
: base(init.self, info)
{
this.info = info;
buildComplete = init.Contains<SkipMakeAnimsInit>();

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA
{
class AttackTurretedInfo : AttackBaseInfo, Requires<TurretedInfo>
{
public override object Create(ActorInitializer init) { return new AttackTurreted(init.self); }
public override object Create(ActorInitializer init) { return new AttackTurreted(init.self, this); }
}
class AttackTurreted : AttackBase, INotifyBuildComplete, ISync
@@ -28,8 +28,8 @@ namespace OpenRA.Mods.RA
protected IEnumerable<Turreted> turrets;
[Sync] protected bool buildComplete;
public AttackTurreted(Actor self)
: base(self)
public AttackTurreted(Actor self, AttackTurretedInfo info)
: base(self, info)
{
turrets = self.TraitsImplementing<Turreted>();
}

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA
[Sync] Target target;
public AttackBomber(Actor self, AttackBomberInfo info)
: base(self)
: base(self, info)
{
this.info = info;
this.camera = null;