Fix style nits in other Attack traits (no logic changes).

This commit is contained in:
Paul Chote
2014-03-08 12:11:23 +13:00
parent a8bd25a6a5
commit 116e4acda3
8 changed files with 22 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -19,11 +19,12 @@ namespace OpenRA.Mods.RA.Air
class AttackHeli : AttackFrontal class AttackHeli : AttackFrontal
{ {
public AttackHeli(Actor self, AttackHeliInfo info) : base(self, info) { } public AttackHeli(Actor self, AttackHeliInfo info)
: base(self, info) { }
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove) public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove)
{ {
return new HeliAttack( newTarget ); return new HeliAttack(newTarget);
} }
} }
} }

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -19,7 +19,8 @@ namespace OpenRA.Mods.RA.Air
class AttackPlane : AttackFrontal class AttackPlane : AttackFrontal
{ {
public AttackPlane(Actor self, AttackPlaneInfo info) : base(self, info) { } public AttackPlane(Actor self, AttackPlaneInfo info)
: base(self, info) { }
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove) public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove)
{ {

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
public class AttackLoyalty : AttackFrontal public class AttackLoyalty : AttackFrontal
{ {
public AttackLoyalty(Actor self, AttackLoyaltyInfo info) public AttackLoyalty(Actor self, AttackLoyaltyInfo info)
: base( self, info ) {} : base(self, info) { }
public override void DoAttack(Actor self, Target target) public override void DoAttack(Actor self, Target target)
{ {

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -28,7 +28,8 @@ namespace OpenRA.Mods.RA
protected IEnumerable<Turreted> turrets; protected IEnumerable<Turreted> turrets;
[Sync] protected bool buildComplete; [Sync] protected bool buildComplete;
public AttackTurreted(Actor self) : base(self) public AttackTurreted(Actor self)
: base(self)
{ {
turrets = self.TraitsImplementing<Turreted>(); turrets = self.TraitsImplementing<Turreted>();
} }
@@ -41,11 +42,13 @@ namespace OpenRA.Mods.RA
if (!target.IsValidFor(self)) if (!target.IsValidFor(self))
return false; return false;
bool canAttack = false; var canAttack = false;
foreach (var t in turrets) foreach (var t in turrets)
if (t.FaceTarget(self, target)) if (t.FaceTarget(self, target))
canAttack = true; canAttack = true;
if (!canAttack) return false;
if (!canAttack)
return false;
return base.CanAttack(self, target); return base.CanAttack(self, target);
} }
@@ -88,7 +91,8 @@ namespace OpenRA.Mods.RA
if (IsCanceled || !target.IsValidFor(self)) if (IsCanceled || !target.IsValidFor(self))
return NextActivity; return NextActivity;
if (self.IsDisabled()) return this; if (self.IsDisabled())
return this;
var attack = self.Trait<AttackTurreted>(); var attack = self.Trait<AttackTurreted>();
const int RangeTolerance = 1; /* how far inside our maximum range we should try to sit */ const int RangeTolerance = 1; /* how far inside our maximum range we should try to sit */

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,