Fix StyleCop warnings in OpenRA.Mods.RA

This commit is contained in:
Hellhake
2015-01-01 23:03:55 +01:00
parent e9989496c4
commit b6410bc1e0
134 changed files with 261 additions and 267 deletions

View File

@@ -65,7 +65,7 @@ namespace OpenRA.Mods.RA.Traits
public override void Tick(Actor self)
{
base.Tick(self);
if (isOpen && !self.World.ActorMap.GetUnitsAt(openExit).Any( a => a != self ))
if (isOpen && !self.World.ActorMap.GetUnitsAt(openExit).Any(a => a != self))
{
isOpen = false;
roof.PlayBackwardsThen(NormalizeSequence(self, "build-top"),

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA.Traits
{
class RenderHarvesterInfo : RenderUnitInfo, Requires<HarvesterInfo>
{
public readonly string[] ImagesByFullness = {"harv"};
public readonly string[] ImagesByFullness = { "harv" };
public override object Create(ActorInitializer init) { return new RenderHarvester(init.self, this); }
}
@@ -58,4 +58,4 @@ namespace OpenRA.Mods.RA.Traits
public void MovingToRefinery(Actor self, CPos targetCell, Activity next) { }
public void MovementCancelled(Actor self) { }
}
}
}

View File

@@ -11,8 +11,8 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Traits

View File

@@ -67,6 +67,7 @@ namespace OpenRA.Mods.RA.Traits
{
buildComplete = false;
}
public void Sold(Actor self) { }
}
}
}

View File

@@ -88,7 +88,7 @@ namespace OpenRA.Mods.RA.Traits
var turretOrientation = turreted != null ? turreted.LocalOrientation(self) : WRot.Zero;
var quantizedBody = body.QuantizeOrientation(self, self.Orientation);
var quantizedTurret = body.QuantizeOrientation(self, turretOrientation);
var quantizedTurret = body.QuantizeOrientation(self, turretOrientation);
return turretOffset + body.LocalToWorld(localOffset.Rotate(quantizedTurret).Rotate(quantizedBody));
}

View File

@@ -87,6 +87,7 @@ namespace OpenRA.Mods.RA.Traits
{
buildComplete = false;
}
public void OnTransform(Actor self) { }
public void AfterTransform(Actor self) { }
@@ -95,4 +96,4 @@ namespace OpenRA.Mods.RA.Traits
overlay.ReplaceAnim(RenderSprites.NormalizeSequence(overlay, e.DamageState, overlay.CurrentSequence.Name));
}
}
}
}

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA.Traits
{
var barrel = b;
var turreted = self.TraitsImplementing<Turreted>()
.FirstOrDefault(t => t.Name == arm.Info.Turret);
.FirstOrDefault(t => t.Name == arm.Info.Turret);
// Workaround for broken ternary operators in certain versions of mono (3.10 and
// certain versions of the 3.8 series): https://bugzilla.xamarin.com/show_bug.cgi?id=23319

View File

@@ -85,7 +85,7 @@ namespace OpenRA.Mods.RA.Traits
if (!info.Recoils)
return t.Position(self);
var recoil = arms.Aggregate(WRange.Zero, (a,b) => a + b.Recoil);
var recoil = arms.Aggregate(WRange.Zero, (a, b) => a + b.Recoil);
var localOffset = new WVec(-recoil, WRange.Zero, WRange.Zero);
var bodyOrientation = body.QuantizeOrientation(self, self.Orientation);
var turretOrientation = body.QuantizeOrientation(self, t.LocalOrientation(self));
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.RA.Traits
anim.ReplaceAnim(sequence);
}
static public int ZOffsetFromCenter(Actor self, WPos pos, int offset)
public static int ZOffsetFromCenter(Actor self, WPos pos, int offset)
{
var delta = self.CenterPosition - pos;
return delta.Y + delta.Z + offset;