From b02ca7695ffe8fdb73a8f719b2ac947adb2e4a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 3 Jul 2014 18:35:11 +0200 Subject: [PATCH] StyleCop --- OpenRA.Mods.RA/Buildings/FootprintUtils.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenRA.Mods.RA/Buildings/FootprintUtils.cs b/OpenRA.Mods.RA/Buildings/FootprintUtils.cs index 0d288dfd97..95a595bfe1 100644 --- a/OpenRA.Mods.RA/Buildings/FootprintUtils.cs +++ b/OpenRA.Mods.RA/Buildings/FootprintUtils.cs @@ -23,13 +23,13 @@ namespace OpenRA.Mods.RA.Buildings var footprint = buildingInfo.Footprint.Where(x => !char.IsWhiteSpace(x)); var buildingTraits = rules.Actors[name].Traits; - if (buildingTraits.Contains() && !(buildingTraits.Get().HasMinibib)) + if (buildingTraits.Contains() && !buildingTraits.Get().HasMinibib) { dim += new CVec(0, 1); footprint = footprint.Concat(new char[dim.X]); } - return TilesWhere( name, dim, footprint.ToArray(), a => a != '_' ).Select( t => t + topLeft ); + return TilesWhere(name, dim, footprint.ToArray(), a => a != '_').Select(t => t + topLeft); } public static IEnumerable Tiles(Actor a) @@ -39,20 +39,20 @@ namespace OpenRA.Mods.RA.Buildings public static IEnumerable UnpathableTiles(string name, BuildingInfo buildingInfo, CPos position) { - var footprint = buildingInfo.Footprint.Where( x => !char.IsWhiteSpace( x ) ).ToArray(); - foreach( var tile in TilesWhere( name, (CVec)buildingInfo.Dimensions, footprint, a => a == 'x' ) ) + var footprint = buildingInfo.Footprint.Where(x => !char.IsWhiteSpace(x)).ToArray(); + foreach (var tile in TilesWhere(name, (CVec)buildingInfo.Dimensions, footprint, a => a == 'x')) yield return tile + position; } static IEnumerable TilesWhere(string name, CVec dim, char[] footprint, Func cond) { - if( footprint.Length != dim.X * dim.Y ) - throw new InvalidOperationException( "Invalid footprint for " + name ); + if (footprint.Length != dim.X * dim.Y) + throw new InvalidOperationException("Invalid footprint for " + name); var index = 0; - for( var y = 0 ; y < dim.Y ; y++ ) - for( var x = 0 ; x < dim.X ; x++ ) - if( cond( footprint[ index++ ] ) ) + for (var y = 0; y < dim.Y; y++) + for (var x = 0; x < dim.X; x++) + if (cond(footprint[index++])) yield return new CVec(x, y); }