StyleCop clean OpenRA.Game

This commit is contained in:
Matthias Mailänder
2015-01-04 11:56:13 +01:00
parent d2d715765c
commit bc3acfeee7
345 changed files with 835 additions and 833 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int[] ShadowIndex = { };
public readonly bool AllowModifiers = true;
public object Create(ActorInitializer init) { return new PaletteFromCurrentTileset(init.world, this); }
public object Create(ActorInitializer init) { return new PaletteFromCurrentTileset(init.World, this); }
}
class PaletteFromCurrentTileset : ILoadsPalettes

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int[] ShadowIndex = { };
public readonly bool AllowModifiers = true;
public object Create(ActorInitializer init) { return new PaletteFromFile(init.world, this); }
public object Create(ActorInitializer init) { return new PaletteFromFile(init.World, this); }
}
class PaletteFromFile : ILoadsPalettes

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int A = 255;
public readonly bool AllowModifiers = true;
public object Create(ActorInitializer init) { return new PaletteFromRGBA(init.world, this); }
public object Create(ActorInitializer init) { return new PaletteFromRGBA(init.World, this); }
}
class PaletteFromRGBA : ILoadsPalettes

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Calculates routes for mobile units based on the A* search algorithm.", " Attach this to the world actor.")]
public class PathFinderInfo : ITraitInfo
{
public object Create(ActorInitializer init) { return new PathFinder(init.world); }
public object Create(ActorInitializer init) { return new PathFinder(init.World); }
}
public class PathFinder

View File

@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits
layer[cell] = layer[cell] * 5 / 6;
// TODO: This doesn't make sense for isometric terrain
var pos = wr.world.Map.CenterOfCell(cell);
var pos = wr.World.Map.CenterOfCell(cell);
var tl = wr.ScreenPxPosition(pos - new WVec(512, 512, 0));
var br = wr.ScreenPxPosition(pos + new WVec(511, 511, 0));
qr.FillRect(RectangleF.FromLTRB(tl.X, tl.Y, br.X, br.Y), Color.FromArgb(w, c));

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string Music = null;
public readonly bool Loop = false;
public object Create(ActorInitializer init) { return new PlayMusicOnMapLoad(init.world, this); }
public object Create(ActorInitializer init) { return new PlayMusicOnMapLoad(init.World, this); }
}
class PlayMusicOnMapLoad : IWorldLoaded

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Apply palette rotatotors or not.")]
public readonly bool AllowModifiers = true;
public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.world, this); }
public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.World, this); }
}
class PlayerPaletteFromCurrentTileset : ILoadsPalettes

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
var c = render[uv.X, uv.Y];
if (c.Sprite != null)
new SpriteRenderable(c.Sprite, wr.world.Map.CenterOfCell(Map.MapToCell(world.Map.TileShape, uv)),
new SpriteRenderable(c.Sprite, wr.World.Map.CenterOfCell(Map.MapToCell(world.Map.TileShape, uv)),
WVec.Zero, -511, c.Type.Palette, 1f, true).Render(wr); // TODO ZOffset is ignored
}
}

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int OverrideFogIndex = 15;
public readonly BlendMode ShroudBlend = BlendMode.Alpha;
public object Create(ActorInitializer init) { return new ShroudRenderer(init.world, this); }
public object Create(ActorInitializer init) { return new ShroudRenderer(init.World, this); }
}
public class ShroudRenderer : IRenderShroud, IWorldLoaded
@@ -298,13 +298,13 @@ namespace OpenRA.Mods.Common.Traits
if (t.Shroud != null)
{
var pos = t.ScreenPosition - 0.5f * t.Shroud.size;
var pos = t.ScreenPosition - 0.5f * t.Shroud.Size;
Game.Renderer.WorldSpriteRenderer.DrawSprite(t.Shroud, pos, shroudPalette);
}
if (t.Fog != null)
{
var pos = t.ScreenPosition - 0.5f * t.Fog.size;
var pos = t.ScreenPosition - 0.5f * t.Fog.Size;
Game.Renderer.WorldSpriteRenderer.DrawSprite(t.Fog, pos, fogPalette);
}
}

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Renders a debug overlay showing the terrain cells. Attach this to the world actor.")]
public class TerrainGeometryOverlayInfo : ITraitInfo
{
public object Create(ActorInitializer init) { return new TerrainGeometryOverlay(init.self); }
public object Create(ActorInitializer init) { return new TerrainGeometryOverlay(init.Self); }
}
public class TerrainGeometryOverlay : IRenderOverlay
@@ -73,8 +73,8 @@ namespace OpenRA.Mods.Common.Traits
if (devMode.Value == null || !devMode.Value.ShowTerrainGeometry)
return;
var ts = wr.world.Map.TileShape;
var colors = wr.world.TileSet.HeightDebugColors;
var ts = wr.World.Map.TileShape;
var colors = wr.World.TileSet.HeightDebugColors;
var leftDelta = ts == TileShape.Diamond ? new WVec(-512, 0, 0) : new WVec(-512, -512, 0);
var topDelta = ts == TileShape.Diamond ? new WVec(0, -512, 0) : new WVec(512, -512, 0);
@@ -84,10 +84,10 @@ namespace OpenRA.Mods.Common.Traits
foreach (var uv in wr.Viewport.VisibleCells.MapCoords)
{
var lr = Game.Renderer.WorldLineRenderer;
var pos = wr.world.Map.CenterOfCell(Map.MapToCell(wr.world.Map.TileShape, uv));
var pos = wr.World.Map.CenterOfCell(Map.MapToCell(wr.World.Map.TileShape, uv));
var height = (int)wr.world.Map.MapHeight.Value[uv.X, uv.Y];
var tile = wr.world.Map.MapTiles.Value[uv.X, uv.Y];
var height = (int)wr.World.Map.MapHeight.Value[uv.X, uv.Y];
var tile = wr.World.Map.MapTiles.Value[uv.X, uv.Y];
TerrainTileInfo tileInfo = null;
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits
// (ra/td templates omit Clear tiles from templates)
try
{
tileInfo = wr.world.TileSet.Templates[tile.Type][tile.Index];
tileInfo = wr.World.TileSet.Templates[tile.Type][tile.Index];
}
catch (Exception) { }