Unify the code style across crate actions.

This commit is contained in:
Paul Chote
2014-09-12 18:26:08 +12:00
parent 8ec8f82178
commit e95974153d
12 changed files with 129 additions and 93 deletions

View File

@@ -25,13 +25,19 @@ namespace OpenRA.Mods.RA
class ExplodeCrateAction : CrateAction
{
readonly ExplodeCrateActionInfo info;
public ExplodeCrateAction(Actor self, ExplodeCrateActionInfo info)
: base(self, info) {}
: base(self, info)
{
this.info = info;
}
public override void Activate(Actor collector)
{
var weapon = self.World.Map.Rules.Weapons[((ExplodeCrateActionInfo)info).Weapon.ToLowerInvariant()];
weapon.Impact(Target.FromPos(collector.CenterPosition), self, Enumerable.Empty<int>());
var weapon = collector.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()];
weapon.Impact(Target.FromPos(collector.CenterPosition), collector, Enumerable.Empty<int>());
base.Activate(collector);
}
}