diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index c688a4eaf9..0a921a3f74 100644 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -288,7 +288,7 @@ namespace OpenRA if (wasInWorld) w.Add(this); - foreach (var t in this.TraitsImplementing()) + foreach (var t in TraitsImplementing()) t.OnOwnerChanged(this, oldOwner, newOwner); }); } @@ -381,7 +381,7 @@ namespace OpenRA public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right) { Actor a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) return false; return a == b; diff --git a/OpenRA.Game/CPos.cs b/OpenRA.Game/CPos.cs index eb23b4f60c..6aaf6f171d 100644 --- a/OpenRA.Game/CPos.cs +++ b/OpenRA.Game/CPos.cs @@ -73,7 +73,7 @@ namespace OpenRA { CPos a; CVec b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call CPos.Add(CPos, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name)); return new LuaCustomClrObject(a + b); @@ -83,7 +83,7 @@ namespace OpenRA { CPos a; CVec b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call CPos.Subtract(CPos, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name)); return new LuaCustomClrObject(a - b); @@ -92,7 +92,7 @@ namespace OpenRA public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right) { CPos a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) return false; return a == b; diff --git a/OpenRA.Game/CVec.cs b/OpenRA.Game/CVec.cs index 38217a87ca..8c6f709959 100644 --- a/OpenRA.Game/CVec.cs +++ b/OpenRA.Game/CVec.cs @@ -75,7 +75,7 @@ namespace OpenRA public LuaValue Add(LuaRuntime runtime, LuaValue left, LuaValue right) { CVec a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call CVec.Add(CVec, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name)); return new LuaCustomClrObject(a + b); @@ -84,7 +84,7 @@ namespace OpenRA public LuaValue Subtract(LuaRuntime runtime, LuaValue left, LuaValue right) { CVec a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call CVec.Subtract(CVec, CVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name)); return new LuaCustomClrObject(a - b); @@ -98,7 +98,7 @@ namespace OpenRA public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right) { CVec a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) return false; return a == b; diff --git a/OpenRA.Game/FieldSaver.cs b/OpenRA.Game/FieldSaver.cs index 102c4fcff0..7339469557 100644 --- a/OpenRA.Game/FieldSaver.cs +++ b/OpenRA.Game/FieldSaver.cs @@ -126,7 +126,7 @@ namespace OpenRA return result; } - if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(OpenRA.Primitives.Cache<,>)) + if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Primitives.Cache<,>)) return ""; // TODO if (t == typeof(DateTime)) diff --git a/OpenRA.Game/FileFormats/BlowfishKeyProvider.cs b/OpenRA.Game/FileFormats/BlowfishKeyProvider.cs index a64a116ce9..16059a5f39 100644 --- a/OpenRA.Game/FileFormats/BlowfishKeyProvider.cs +++ b/OpenRA.Game/FileFormats/BlowfishKeyProvider.cs @@ -55,7 +55,7 @@ namespace OpenRA.FileFormats { var pn = (byte*)tempPn; var i = blen * 4; - for (; i > klen; i--) pn[i - 1] = (byte)sign; + for (; i > klen; i--) pn[i - 1] = sign; for (; i > 0; i--) pn[i - 1] = key[klen - i]; } } diff --git a/OpenRA.Game/FileFormats/HvaReader.cs b/OpenRA.Game/FileFormats/HvaReader.cs index 72424e4960..1efb308af9 100644 --- a/OpenRA.Game/FileFormats/HvaReader.cs +++ b/OpenRA.Game/FileFormats/HvaReader.cs @@ -11,7 +11,6 @@ using System; using System.IO; -using System.Linq; using OpenRA.Graphics; namespace OpenRA.FileFormats diff --git a/OpenRA.Game/FileFormats/ImaAdpcmLoader.cs b/OpenRA.Game/FileFormats/ImaAdpcmLoader.cs index d30d8a56c5..38ec94bc7e 100644 --- a/OpenRA.Game/FileFormats/ImaAdpcmLoader.cs +++ b/OpenRA.Game/FileFormats/ImaAdpcmLoader.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.IO; namespace OpenRA.FileFormats diff --git a/OpenRA.Game/FileFormats/XccLocalDatabase.cs b/OpenRA.Game/FileFormats/XccLocalDatabase.cs index 5fccbdfb9a..4abc330920 100644 --- a/OpenRA.Game/FileFormats/XccLocalDatabase.cs +++ b/OpenRA.Game/FileFormats/XccLocalDatabase.cs @@ -49,11 +49,11 @@ namespace OpenRA.FileFormats writer.Write(Encoding.ASCII.GetBytes("XCC by Olaf van der Spek")); writer.Write(new byte[] { 0x1A, 0x04, 0x17, 0x27, 0x10, 0x19, 0x80, 0x00 }); - writer.Write((int)(Entries.Aggregate(Entries.Length, (a, b) => a + b.Length) + 52)); // Size - writer.Write((int)0); // Type - writer.Write((int)0); // Version - writer.Write((int)0); // Game/Format (0 == TD) - writer.Write((int)Entries.Length); // Entries + writer.Write(Entries.Aggregate(Entries.Length, (a, b) => a + b.Length) + 52); // Size + writer.Write(0); // Type + writer.Write(0); // Version + writer.Write(0); // Game/Format (0 == TD) + writer.Write(Entries.Length); // Entries foreach (var e in Entries) { writer.Write(Encoding.ASCII.GetBytes(e)); diff --git a/OpenRA.Game/FileSystem/D2kSoundResources.cs b/OpenRA.Game/FileSystem/D2kSoundResources.cs index 2e2bc35c96..b587df77c9 100644 --- a/OpenRA.Game/FileSystem/D2kSoundResources.cs +++ b/OpenRA.Game/FileSystem/D2kSoundResources.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.IO; diff --git a/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs b/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs index ac9deb296c..618810ada4 100644 --- a/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs +++ b/OpenRA.Game/FileSystem/InstallShieldCABExtractor.cs @@ -43,7 +43,7 @@ namespace OpenRA.FileSystem FirstFile = reader.ReadUInt32(); LastFile = reader.ReadUInt32(); - reader.Seek(offset + (long)nameOffset, SeekOrigin.Begin); + reader.Seek(offset + nameOffset, SeekOrigin.Begin); Name = reader.ReadASCIIZ(); } } @@ -107,7 +107,7 @@ namespace OpenRA.FileSystem { Version = reader.ReadUInt32(); VolumeInfo = reader.ReadUInt32(); - CabDescriptorOffset = (long)reader.ReadUInt32(); + CabDescriptorOffset = reader.ReadUInt32(); CabDescriptorSize = reader.ReadUInt32(); } } @@ -125,7 +125,7 @@ namespace OpenRA.FileSystem public CabDescriptor(Stream reader, CommonHeader commonHeader) { reader.Seek(commonHeader.CabDescriptorOffset + 12, SeekOrigin.Begin); - FileTableOffset = (long)reader.ReadUInt32(); + FileTableOffset = reader.ReadUInt32(); /* unknown */ reader.ReadUInt32(); FileTableSize = reader.ReadUInt32(); @@ -134,7 +134,7 @@ namespace OpenRA.FileSystem /* unknown */ reader.ReadBytes(8); FileCount = reader.ReadUInt32(); - FileTableOffset2 = (long)reader.ReadUInt32(); + FileTableOffset2 = reader.ReadUInt32(); } } @@ -201,7 +201,7 @@ namespace OpenRA.FileSystem this.index = index; this.commonName = commonName; this.context = context; - volumeNumber = (ushort)((uint)fileDes.Volume - 1u); + volumeNumber = (ushort)(fileDes.Volume - 1u); RemainingArchiveStream = 0; if ((fileDes.Flags & FileCompressed) > 0) RemainingFileStream = fileDes.CompressedSize; @@ -374,7 +374,7 @@ namespace OpenRA.FileSystem hdrFile.Seek((long)nextOffset + 4 + commonHeader.CabDescriptorOffset, SeekOrigin.Begin); var descriptorOffset = hdrFile.ReadUInt32(); nextOffset = hdrFile.ReadUInt32(); - hdrFile.Seek((long)descriptorOffset + commonHeader.CabDescriptorOffset, SeekOrigin.Begin); + hdrFile.Seek(descriptorOffset + commonHeader.CabDescriptorOffset, SeekOrigin.Begin); fileGroups.Add(new FileGroup(hdrFile, commonHeader.CabDescriptorOffset)); } @@ -387,7 +387,7 @@ namespace OpenRA.FileSystem { AddFileDescriptorToList(index); var fileDescriptor = fileDescriptors[index]; - var fullFilePath = "{0}\\{1}\\{2}".F(fileGroup.Name, DirectoryName((uint)fileDescriptor.DirectoryIndex), fileDescriptor.Filename); + var fullFilePath = "{0}\\{1}\\{2}".F(fileGroup.Name, DirectoryName(fileDescriptor.DirectoryIndex), fileDescriptor.Filename); fileLookup.Add(fullFilePath, index); } } diff --git a/OpenRA.Game/FileSystem/Pak.cs b/OpenRA.Game/FileSystem/Pak.cs index 1e9f8727a2..e7fc40023e 100644 --- a/OpenRA.Game/FileSystem/Pak.cs +++ b/OpenRA.Game/FileSystem/Pak.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.IO; diff --git a/OpenRA.Game/FileSystem/ZipFile.cs b/OpenRA.Game/FileSystem/ZipFile.cs index bc8bb639cd..f376e23e68 100644 --- a/OpenRA.Game/FileSystem/ZipFile.cs +++ b/OpenRA.Game/FileSystem/ZipFile.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.IO; using System.Text; diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 844a3db0a1..4851c3fd1a 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -86,7 +86,7 @@ namespace OpenRA // More accurate replacement for Environment.TickCount static Stopwatch stopwatch = Stopwatch.StartNew(); - public static int RunTime { get { return (int)Game.stopwatch.ElapsedMilliseconds; } } + public static int RunTime { get { return (int)stopwatch.ElapsedMilliseconds; } } public static int RenderFrame = 0; public static int NetFrameNumber { get { return OrderManager.NetFrameNumber; } } @@ -461,8 +461,8 @@ namespace OpenRA // Note: These delayed actions should only be used by widgets or disposing objects // - things that depend on a particular world should be queuing them on the world actor. static volatile ActionQueue delayedActions = new ActionQueue(); - public static void RunAfterTick(Action a) { delayedActions.Add(a, Game.RunTime); } - public static void RunAfterDelay(int delayMilliseconds, Action a) { delayedActions.Add(a, Game.RunTime + delayMilliseconds); } + public static void RunAfterTick(Action a) { delayedActions.Add(a, RunTime); } + public static void RunAfterDelay(int delayMilliseconds, Action a) { delayedActions.Add(a, RunTime + delayMilliseconds); } static void TakeScreenshotInner() { @@ -489,7 +489,7 @@ namespace OpenRA bitmap.Dispose(); - Game.RunAfterTick(() => Debug("Saved screenshot " + filename)); + RunAfterTick(() => Debug("Saved screenshot " + filename)); }); } @@ -571,7 +571,7 @@ namespace OpenRA static void LogicTick() { - delayedActions.PerformActions(Game.RunTime); + delayedActions.PerformActions(RunTime); if (OrderManager.Connection.ConnectionState != lastConnectionState) { @@ -604,9 +604,9 @@ namespace OpenRA using (new PerfSample("render_widgets")) { - Game.Renderer.WorldVoxelRenderer.BeginFrame(); + Renderer.WorldVoxelRenderer.BeginFrame(); Ui.PrepareRenderables(); - Game.Renderer.WorldVoxelRenderer.EndFrame(); + Renderer.WorldVoxelRenderer.EndFrame(); Ui.Draw(); @@ -684,7 +684,7 @@ namespace OpenRA { // Ideal time between logic updates. Timestep = 0 means the game is paused // but we still call LogicTick() because it handles pausing internally. - var logicInterval = worldRenderer != null && worldRenderer.World.Timestep != 0 ? worldRenderer.World.Timestep : Game.Timestep; + var logicInterval = worldRenderer != null && worldRenderer.World.Timestep != 0 ? worldRenderer.World.Timestep : Timestep; // Ideal time between screen updates var maxFramerate = Settings.Graphics.CapFramerate ? Settings.Graphics.MaxFramerate.Clamp(1, 1000) : 1000; diff --git a/OpenRA.Game/GameSpeed.cs b/OpenRA.Game/GameSpeed.cs index 24e7eebac8..2a4fe66b54 100644 --- a/OpenRA.Game/GameSpeed.cs +++ b/OpenRA.Game/GameSpeed.cs @@ -8,10 +8,7 @@ */ #endregion -using System; using System.Collections.Generic; -using System.Linq; -using OpenRA.Graphics; namespace OpenRA { diff --git a/OpenRA.Game/GlobalChat.cs b/OpenRA.Game/GlobalChat.cs index 1638210af5..1da37efd32 100644 --- a/OpenRA.Game/GlobalChat.cs +++ b/OpenRA.Game/GlobalChat.cs @@ -10,11 +10,9 @@ using System; using System.Collections; -using System.Collections.Generic; using System.Linq; using System.Threading; using Meebey.SmartIrc4net; -using OpenRA; using OpenRA.Primitives; namespace OpenRA.Chat diff --git a/OpenRA.Game/Graphics/ChromeProvider.cs b/OpenRA.Game/Graphics/ChromeProvider.cs index 7a4490a24c..6a24e654cf 100644 --- a/OpenRA.Game/Graphics/ChromeProvider.cs +++ b/OpenRA.Game/Graphics/ChromeProvider.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.IO; using System.Linq; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/HardwareCursor.cs b/OpenRA.Game/Graphics/HardwareCursor.cs index 0512799685..f76a06f9a7 100644 --- a/OpenRA.Game/Graphics/HardwareCursor.cs +++ b/OpenRA.Game/Graphics/HardwareCursor.cs @@ -12,8 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.Graphics; -using OpenRA.Primitives; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/MappedImage.cs b/OpenRA.Game/Graphics/MappedImage.cs index e83024b387..acdf00f93c 100644 --- a/OpenRA.Game/Graphics/MappedImage.cs +++ b/OpenRA.Game/Graphics/MappedImage.cs @@ -37,7 +37,7 @@ namespace OpenRA.Graphics if (defaultSrc != Src) root.Add(new MiniYamlNode("Src", Src)); - return new MiniYaml(FieldSaver.FormatValue(this, this.GetType().GetField("rect")), root); + return new MiniYaml(FieldSaver.FormatValue(this, GetType().GetField("rect")), root); } } } diff --git a/OpenRA.Game/Graphics/Palette.cs b/OpenRA.Game/Graphics/Palette.cs index 1b882d097d..32b3064e70 100644 --- a/OpenRA.Game/Graphics/Palette.cs +++ b/OpenRA.Game/Graphics/Palette.cs @@ -57,7 +57,7 @@ namespace OpenRA.Graphics var b = new Bitmap(Size, 1, PixelFormat.Format32bppArgb); var data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); - var temp = new uint[Palette.Size]; + var temp = new uint[Size]; palette.CopyToArray(temp, 0); Marshal.Copy((int[])(object)temp, 0, data.Scan0, Size); b.UnlockBits(data); diff --git a/OpenRA.Game/Graphics/PaletteReference.cs b/OpenRA.Game/Graphics/PaletteReference.cs index 88ffdae1e3..ad6f84fcb1 100644 --- a/OpenRA.Game/Graphics/PaletteReference.cs +++ b/OpenRA.Game/Graphics/PaletteReference.cs @@ -8,12 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using OpenRA.Traits; - namespace OpenRA.Graphics { public sealed class PaletteReference diff --git a/OpenRA.Game/Graphics/PlayerColorRemap.cs b/OpenRA.Game/Graphics/PlayerColorRemap.cs index 27a80edf53..cd57f0504a 100644 --- a/OpenRA.Game/Graphics/PlayerColorRemap.cs +++ b/OpenRA.Game/Graphics/PlayerColorRemap.cs @@ -29,7 +29,7 @@ namespace OpenRA.Graphics { // Increase luminosity if required to represent the full ramp var rampRange = (byte)((1 - rampFraction) * c.L); - var c1 = new HSLColor(c.H, c.S, (byte)Math.Max(rampRange, c.L)).RGB; + var c1 = new HSLColor(c.H, c.S, Math.Max(rampRange, c.L)).RGB; var c2 = new HSLColor(c.H, c.S, (byte)Math.Max(0, c.L - rampRange)).RGB; var baseIndex = ramp[0]; var remapRamp = ramp.Select(r => r - ramp[0]); diff --git a/OpenRA.Game/Graphics/Renderable.cs b/OpenRA.Game/Graphics/Renderable.cs index 14ad932990..a42608c01c 100644 --- a/OpenRA.Game/Graphics/Renderable.cs +++ b/OpenRA.Game/Graphics/Renderable.cs @@ -8,9 +8,7 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; -using System.Linq; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/SelectionBarsRenderable.cs b/OpenRA.Game/Graphics/SelectionBarsRenderable.cs index df6ed1a018..339cae94f4 100644 --- a/OpenRA.Game/Graphics/SelectionBarsRenderable.cs +++ b/OpenRA.Game/Graphics/SelectionBarsRenderable.cs @@ -9,7 +9,6 @@ #endregion using System.Drawing; -using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/SequenceProvider.cs b/OpenRA.Game/Graphics/SequenceProvider.cs index ba041076d4..3838306b4d 100644 --- a/OpenRA.Game/Graphics/SequenceProvider.cs +++ b/OpenRA.Game/Graphics/SequenceProvider.cs @@ -10,9 +10,7 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Reflection; namespace OpenRA.Graphics { @@ -50,8 +48,8 @@ namespace OpenRA.Graphics public SequenceProvider(SequenceCache cache, Map map) { - this.sequences = Exts.Lazy(() => cache.LoadSequences(map)); - this.SpriteCache = cache.SpriteCache; + sequences = Exts.Lazy(() => cache.LoadSequences(map)); + SpriteCache = cache.SpriteCache; } public ISpriteSequence GetSequence(string unitName, string sequenceName) diff --git a/OpenRA.Game/Graphics/Sheet.cs b/OpenRA.Game/Graphics/Sheet.cs index 73f9a2b89a..f0c12ac745 100644 --- a/OpenRA.Game/Graphics/Sheet.cs +++ b/OpenRA.Game/Graphics/Sheet.cs @@ -12,7 +12,6 @@ using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/SheetBuilder.cs b/OpenRA.Game/Graphics/SheetBuilder.cs index 73d42ca056..3d6b594c61 100644 --- a/OpenRA.Game/Graphics/SheetBuilder.cs +++ b/OpenRA.Game/Graphics/SheetBuilder.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/SoftwareCursor.cs b/OpenRA.Game/Graphics/SoftwareCursor.cs index 9be1f80b31..5638821006 100644 --- a/OpenRA.Game/Graphics/SoftwareCursor.cs +++ b/OpenRA.Game/Graphics/SoftwareCursor.cs @@ -10,9 +10,7 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; -using OpenRA.Graphics; using OpenRA.Primitives; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/TargetLineRenderable.cs b/OpenRA.Game/Graphics/TargetLineRenderable.cs index 8d4b81077b..0e91746791 100644 --- a/OpenRA.Game/Graphics/TargetLineRenderable.cs +++ b/OpenRA.Game/Graphics/TargetLineRenderable.cs @@ -11,8 +11,6 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/TerrainSpriteLayer.cs b/OpenRA.Game/Graphics/TerrainSpriteLayer.cs index 4da279e2f5..34dbecf509 100644 --- a/OpenRA.Game/Graphics/TerrainSpriteLayer.cs +++ b/OpenRA.Game/Graphics/TerrainSpriteLayer.cs @@ -12,8 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.IO; -using System.Linq; -using OpenRA.Traits; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/Theater.cs b/OpenRA.Game/Graphics/Theater.cs index 5f0e37fcfa..948a89a307 100644 --- a/OpenRA.Game/Graphics/Theater.cs +++ b/OpenRA.Game/Graphics/Theater.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.FileSystem; using OpenRA.Support; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/UISpriteRenderable.cs b/OpenRA.Game/Graphics/UISpriteRenderable.cs index 03fc578280..bdb73c0769 100644 --- a/OpenRA.Game/Graphics/UISpriteRenderable.cs +++ b/OpenRA.Game/Graphics/UISpriteRenderable.cs @@ -8,9 +8,7 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; -using System.Linq; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/Util.cs b/OpenRA.Game/Graphics/Util.cs index 0178c5ffc5..2cd81e69d3 100644 --- a/OpenRA.Game/Graphics/Util.cs +++ b/OpenRA.Game/Graphics/Util.cs @@ -11,7 +11,6 @@ using System; using System.Drawing; using System.Drawing.Imaging; -using System.Runtime.InteropServices; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/VoxelRenderer.cs b/OpenRA.Game/Graphics/VoxelRenderer.cs index a7eb0a3ddf..4fc47f3dbe 100644 --- a/OpenRA.Game/Graphics/VoxelRenderer.cs +++ b/OpenRA.Game/Graphics/VoxelRenderer.cs @@ -25,7 +25,7 @@ namespace OpenRA.Graphics public VoxelRenderProxy(Sprite sprite, Sprite shadowSprite, float2[] projectedShadowBounds, float shadowDirection) { - this.Sprite = sprite; + Sprite = sprite; ShadowSprite = shadowSprite; ProjectedShadowBounds = projectedShadowBounds; ShadowDirection = shadowDirection; diff --git a/OpenRA.Game/Map/ActorInitializer.cs b/OpenRA.Game/Map/ActorInitializer.cs index cec08ff113..2ba2fc57a4 100644 --- a/OpenRA.Game/Map/ActorInitializer.cs +++ b/OpenRA.Game/Map/ActorInitializer.cs @@ -86,12 +86,12 @@ namespace OpenRA Player player; public OwnerInit() { } - public OwnerInit(string playerName) { this.PlayerName = playerName; } + public OwnerInit(string playerName) { PlayerName = playerName; } public OwnerInit(Player player) { this.player = player; - this.PlayerName = player.InternalName; + PlayerName = player.InternalName; } public Player Value(World world) diff --git a/OpenRA.Game/Map/CellLayer.cs b/OpenRA.Game/Map/CellLayer.cs index e9267b46d9..dc6c16ac06 100644 --- a/OpenRA.Game/Map/CellLayer.cs +++ b/OpenRA.Game/Map/CellLayer.cs @@ -74,7 +74,7 @@ namespace OpenRA return uv.V * Size.Width + uv.U; } - /// Gets or sets the using cell coordinates + /// Gets or sets the using cell coordinates public T this[CPos cell] { get diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index e49af98b91..230c794bf4 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -16,7 +16,6 @@ using System.Linq; using System.Security.Cryptography; using System.Text; using OpenRA.FileSystem; -using OpenRA.GameRules; using OpenRA.Graphics; using OpenRA.Network; using OpenRA.Support; @@ -277,7 +276,7 @@ namespace OpenRA { var size = new Size(width, height); Grid = Game.ModData.Manifest.Get(); - var tileRef = new TerrainTile(tileset.Templates.First().Key, (byte)0); + var tileRef = new TerrainTile(tileset.Templates.First().Key, 0); Title = "Name your map here"; Description = "Describe your map here"; @@ -604,7 +603,7 @@ namespace OpenRA foreach (var field in fields) { - var f = this.GetType().GetField(field); + var f = GetType().GetField(field); if (f.GetValue(this) == null) continue; root.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f))); diff --git a/OpenRA.Game/Map/MapCoordsRegion.cs b/OpenRA.Game/Map/MapCoordsRegion.cs index a7540b4e01..e99caae430 100644 --- a/OpenRA.Game/Map/MapCoordsRegion.cs +++ b/OpenRA.Game/Map/MapCoordsRegion.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Collections; using System.Collections.Generic; -using System.Linq; namespace OpenRA { @@ -64,8 +62,8 @@ namespace OpenRA public MapCoordsRegion(MPos mapTopLeft, MPos mapBottomRight) { - this.topLeft = mapTopLeft; - this.bottomRight = mapBottomRight; + topLeft = mapTopLeft; + bottomRight = mapBottomRight; } public MapCoordsEnumerator GetEnumerator() diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index f5fc318bc1..f8c35c9b40 100644 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Drawing; -using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Net; diff --git a/OpenRA.Game/Map/TileSet.cs b/OpenRA.Game/Map/TileSet.cs index 438131a2a8..c7b9ff6fe8 100644 --- a/OpenRA.Game/Map/TileSet.cs +++ b/OpenRA.Game/Map/TileSet.cs @@ -79,9 +79,9 @@ namespace OpenRA public TerrainTemplateInfo(ushort id, string[] images, int2 size, byte[] tiles) { - this.Id = id; - this.Images = images; - this.Size = size; + Id = id; + Images = images; + Size = size; } public TerrainTemplateInfo(TileSet tileSet, MiniYaml my) diff --git a/OpenRA.Game/Network/Connection.cs b/OpenRA.Game/Network/Connection.cs index ec413c0f4f..99cc845ee7 100644 --- a/OpenRA.Game/Network/Connection.cs +++ b/OpenRA.Game/Network/Connection.cs @@ -68,7 +68,7 @@ namespace OpenRA.Network public virtual void SendImmediate(List orders) { var ms = new MemoryStream(); - ms.Write(BitConverter.GetBytes((int)0)); + ms.Write(BitConverter.GetBytes(0)); foreach (var o in orders) ms.Write(o); Send(ms.ToArray()); @@ -196,12 +196,12 @@ namespace OpenRA.Network try { var ms = new MemoryStream(); - ms.Write(BitConverter.GetBytes((int)packet.Length)); + ms.Write(BitConverter.GetBytes(packet.Length)); ms.Write(packet); foreach (var q in queuedSyncPackets) { - ms.Write(BitConverter.GetBytes((int)q.Length)); + ms.Write(BitConverter.GetBytes(q.Length)); ms.Write(q); base.Send(q); } diff --git a/OpenRA.Game/Network/GeoIP.cs b/OpenRA.Game/Network/GeoIP.cs index fb42d78051..f85a72a76e 100644 --- a/OpenRA.Game/Network/GeoIP.cs +++ b/OpenRA.Game/Network/GeoIP.cs @@ -10,7 +10,6 @@ using System; using System.IO; -using ICSharpCode.SharpZipLib.Core; using ICSharpCode.SharpZipLib.GZip; using MaxMind.GeoIP2; diff --git a/OpenRA.Game/Network/Order.cs b/OpenRA.Game/Network/Order.cs index dd8f390d63..fb6a1c3368 100644 --- a/OpenRA.Game/Network/Order.cs +++ b/OpenRA.Game/Network/Order.cs @@ -10,7 +10,6 @@ using System; using System.IO; -using System.Linq; using OpenRA.Network; namespace OpenRA @@ -52,14 +51,14 @@ namespace OpenRA Order(string orderString, Actor subject, Actor targetActor, CPos targetLocation, string targetString, bool queued, CPos extraLocation, uint extraData) { - this.OrderString = orderString; - this.Subject = subject; - this.TargetActor = targetActor; - this.TargetLocation = targetLocation; - this.TargetString = targetString; - this.Queued = queued; - this.ExtraLocation = extraLocation; - this.ExtraData = extraData; + OrderString = orderString; + Subject = subject; + TargetActor = targetActor; + TargetLocation = targetLocation; + TargetString = targetString; + Queued = queued; + ExtraLocation = extraLocation; + ExtraData = extraData; } public static Order Deserialize(World world, BinaryReader r) diff --git a/OpenRA.Game/Network/ReplayRecorder.cs b/OpenRA.Game/Network/ReplayRecorder.cs index 381c2fd4f1..f6f0e923d3 100644 --- a/OpenRA.Game/Network/ReplayRecorder.cs +++ b/OpenRA.Game/Network/ReplayRecorder.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.IO; using System.Linq; using OpenRA.FileFormats; @@ -64,7 +63,7 @@ namespace OpenRA.Network } file.Write(initialContent); - this.writer = new BinaryWriter(file); + writer = new BinaryWriter(file); } public void Receive(int clientID, byte[] data) diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index f0b87c4841..90f414cc44 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using OpenRA.Graphics; namespace OpenRA.Orders { diff --git a/OpenRA.Game/Orders/UnitOrderGenerator.cs b/OpenRA.Game/Orders/UnitOrderGenerator.cs index 5167300b73..407e465c71 100644 --- a/OpenRA.Game/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Game/Orders/UnitOrderGenerator.cs @@ -167,11 +167,11 @@ namespace OpenRA.Orders public UnitOrderResult(Actor actor, IOrderTargeter order, IIssueOrder trait, string cursor, Target target) { - this.Actor = actor; - this.Order = order; - this.Trait = trait; - this.Cursor = cursor; - this.Target = target; + Actor = actor; + Order = order; + Trait = trait; + Cursor = cursor; + Target = target; } } } diff --git a/OpenRA.Game/Primitives/int2.cs b/OpenRA.Game/Primitives/int2.cs index 2d0a31c4e1..aeecf50ef3 100644 --- a/OpenRA.Game/Primitives/int2.cs +++ b/OpenRA.Game/Primitives/int2.cs @@ -18,7 +18,7 @@ namespace OpenRA public struct int2 : IEquatable { public readonly int X, Y; - public int2(int x, int y) { this.X = x; this.Y = y; } + public int2(int x, int y) { X = x; Y = y; } public int2(Point p) { X = p.X; Y = p.Y; } public int2(Size p) { X = p.Width; Y = p.Height; } @@ -66,7 +66,7 @@ namespace OpenRA // Change endianness of a uint32 public static uint Swap(uint orig) { - return (uint)((orig & 0xff000000) >> 24) | ((orig & 0x00ff0000) >> 8) | ((orig & 0x0000ff00) << 8) | ((orig & 0x000000ff) << 24); + return ((orig & 0xff000000) >> 24) | ((orig & 0x00ff0000) >> 8) | ((orig & 0x0000ff00) << 8) | ((orig & 0x000000ff) << 24); } public static int Lerp(int a, int b, int mul, int div) diff --git a/OpenRA.Game/Renderer.cs b/OpenRA.Game/Renderer.cs index 6989ec3ca7..6e669c68ef 100644 --- a/OpenRA.Game/Renderer.cs +++ b/OpenRA.Game/Renderer.cs @@ -95,7 +95,7 @@ namespace OpenRA if (Fonts != null) foreach (var font in Fonts.Values) font.Dispose(); - using (new Support.PerfTimer("SpriteFonts")) + using (new PerfTimer("SpriteFonts")) { if (fontSheetBuilder != null) fontSheetBuilder.Dispose(); diff --git a/OpenRA.Game/Scripting/ScriptActorInterface.cs b/OpenRA.Game/Scripting/ScriptActorInterface.cs index fac44ea7a4..71e5d3614c 100644 --- a/OpenRA.Game/Scripting/ScriptActorInterface.cs +++ b/OpenRA.Game/Scripting/ScriptActorInterface.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; namespace OpenRA.Scripting diff --git a/OpenRA.Game/Scripting/ScriptContext.cs b/OpenRA.Game/Scripting/ScriptContext.cs index e98c5b410b..ac79840cff 100644 --- a/OpenRA.Game/Scripting/ScriptContext.cs +++ b/OpenRA.Game/Scripting/ScriptContext.cs @@ -86,8 +86,8 @@ namespace OpenRA.Scripting public ScriptGlobal(ScriptContext context) : base(context) { - // The 'this.' resolves the actual (subclass) type - var type = this.GetType(); + // GetType resolves the actual (subclass) type + var type = GetType(); var names = type.GetCustomAttributes(true); if (names.Length != 1) throw new InvalidOperationException("[ScriptGlobal] attribute not found for global table '{0}'".F(type)); diff --git a/OpenRA.Game/Scripting/ScriptTypes.cs b/OpenRA.Game/Scripting/ScriptTypes.cs index d9011d2dac..7d797474b7 100644 --- a/OpenRA.Game/Scripting/ScriptTypes.cs +++ b/OpenRA.Game/Scripting/ScriptTypes.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections; using Eluant; namespace OpenRA.Scripting @@ -145,16 +144,16 @@ namespace OpenRA.Scripting return LuaNil.Instance; if (obj is double) - return (LuaValue)(double)obj; + return (double)obj; if (obj is int) - return (LuaValue)(int)obj; + return (int)obj; if (obj is bool) - return (LuaValue)(bool)obj; + return (bool)obj; if (obj is string) - return (LuaValue)(string)obj; + return (string)obj; if (obj is IScriptBindable) { diff --git a/OpenRA.Game/Support/LaunchArguments.cs b/OpenRA.Game/Support/LaunchArguments.cs index 6663544bb4..543cc4f337 100644 --- a/OpenRA.Game/Support/LaunchArguments.cs +++ b/OpenRA.Game/Support/LaunchArguments.cs @@ -29,7 +29,7 @@ namespace OpenRA if (args == null) return; - foreach (var f in this.GetType().GetFields()) + foreach (var f in GetType().GetFields()) if (args.Contains("Launch" + "." + f.Name)) FieldLoader.LoadField(this, f.Name, args.GetValue("Launch" + "." + f.Name, "")); } diff --git a/OpenRA.Game/Support/PerfHistory.cs b/OpenRA.Game/Support/PerfHistory.cs index a3ab350de9..dde2bba8f7 100644 --- a/OpenRA.Game/Support/PerfHistory.cs +++ b/OpenRA.Game/Support/PerfHistory.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Diagnostics; using System.Drawing; using OpenRA.Primitives; diff --git a/OpenRA.Game/Support/PerfItem.cs b/OpenRA.Game/Support/PerfItem.cs index bd314cd4e1..3c67b172de 100644 --- a/OpenRA.Game/Support/PerfItem.cs +++ b/OpenRA.Game/Support/PerfItem.cs @@ -8,11 +8,8 @@ */ #endregion -using System; using System.Collections.Generic; -using System.Diagnostics; using System.Drawing; -using OpenRA.Primitives; namespace OpenRA.Support { diff --git a/OpenRA.Game/Support/PerfSample.cs b/OpenRA.Game/Support/PerfSample.cs index e00183047e..6abad724f6 100644 --- a/OpenRA.Game/Support/PerfSample.cs +++ b/OpenRA.Game/Support/PerfSample.cs @@ -9,10 +9,7 @@ #endregion using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Drawing; -using OpenRA.Primitives; namespace OpenRA.Support { diff --git a/OpenRA.Game/Sync.cs b/OpenRA.Game/Sync.cs index 0cfe283921..9492016424 100644 --- a/OpenRA.Game/Sync.cs +++ b/OpenRA.Game/Sync.cs @@ -38,11 +38,11 @@ namespace OpenRA { typeof(int2), ((Func)HashInt2).Method }, { typeof(CPos), ((Func)HashCPos).Method }, { typeof(CVec), ((Func)HashCVec).Method }, - { typeof(WDist), ((Func)Hash).Method }, - { typeof(WPos), ((Func)Hash).Method }, - { typeof(WVec), ((Func)Hash).Method }, - { typeof(WAngle), ((Func)Hash).Method }, - { typeof(WRot), ((Func)Hash).Method }, + { typeof(WDist), ((Func)Hash).Method }, + { typeof(WPos), ((Func)Hash).Method }, + { typeof(WVec), ((Func)Hash).Method }, + { typeof(WAngle), ((Func)Hash).Method }, + { typeof(WRot), ((Func)Hash).Method }, { typeof(TypeDictionary), ((Func)HashTDict).Method }, { typeof(Actor), ((Func)HashActor).Method }, { typeof(Player), ((Func)HashPlayer).Method }, @@ -152,7 +152,7 @@ namespace OpenRA return (int)(t.FrozenActor.Actor.ActorID << 16) * 0x567; case TargetType.Terrain: - return Hash(t.CenterPosition); + return Hash(t.CenterPosition); default: case TargetType.Invalid: diff --git a/OpenRA.Game/Traits/Player/PlayerColorPalette.cs b/OpenRA.Game/Traits/Player/PlayerColorPalette.cs index 2ab28ec136..701087a84f 100644 --- a/OpenRA.Game/Traits/Player/PlayerColorPalette.cs +++ b/OpenRA.Game/Traits/Player/PlayerColorPalette.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using OpenRA.Graphics; namespace OpenRA.Traits diff --git a/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs b/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs index 08e2a5753f..98d46ea86a 100644 --- a/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs +++ b/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Graphics; diff --git a/OpenRA.Game/Traits/RejectsOrders.cs b/OpenRA.Game/Traits/RejectsOrders.cs index 21d680792b..351e4ab63d 100644 --- a/OpenRA.Game/Traits/RejectsOrders.cs +++ b/OpenRA.Game/Traits/RejectsOrders.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/World/ResourceType.cs b/OpenRA.Game/Traits/World/ResourceType.cs index e3268b5d53..24e3e3df5e 100644 --- a/OpenRA.Game/Traits/World/ResourceType.cs +++ b/OpenRA.Game/Traits/World/ResourceType.cs @@ -43,7 +43,7 @@ namespace OpenRA.Traits public ResourceType(ResourceTypeInfo info, World world) { - this.Info = info; + Info = info; Variants = new Dictionary(); foreach (var v in info.Variants) { diff --git a/OpenRA.Game/VoiceExts.cs b/OpenRA.Game/VoiceExts.cs index 9cdc1ea884..da01e05c81 100644 --- a/OpenRA.Game/VoiceExts.cs +++ b/OpenRA.Game/VoiceExts.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Traits; diff --git a/OpenRA.Game/WDist.cs b/OpenRA.Game/WDist.cs index 0b14f3d78e..456b7ad834 100644 --- a/OpenRA.Game/WDist.cs +++ b/OpenRA.Game/WDist.cs @@ -23,7 +23,7 @@ namespace OpenRA public struct WDist : IComparable, IComparable, IEquatable, IScriptBindable, ILuaAdditionBinding, ILuaSubtractionBinding, ILuaEqualityBinding, ILuaTableBinding { public readonly int Length; - public long LengthSquared { get { return (long)Length * (long)Length; } } + public long LengthSquared { get { return (long)Length * Length; } } public WDist(int r) { Length = r; } public static readonly WDist Zero = new WDist(0); @@ -57,7 +57,7 @@ namespace OpenRA public static bool TryParse(string s, out WDist result) { - result = WDist.Zero; + result = Zero; if (string.IsNullOrEmpty(s)) return false; @@ -115,7 +115,7 @@ namespace OpenRA { WDist a; WDist b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call WDist.Add(WDist, WDist) with invalid arguments."); return new LuaCustomClrObject(a + b); @@ -125,7 +125,7 @@ namespace OpenRA { WDist a; WDist b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call WDist.Subtract(WDist, WDist) with invalid arguments."); return new LuaCustomClrObject(a - b); @@ -135,7 +135,7 @@ namespace OpenRA { WDist a; WDist b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call WDist.Equals(WDist, WDist) with invalid arguments."); return a == b; diff --git a/OpenRA.Game/WPos.cs b/OpenRA.Game/WPos.cs index 7d3453ce85..5d9800be0a 100644 --- a/OpenRA.Game/WPos.cs +++ b/OpenRA.Game/WPos.cs @@ -81,7 +81,7 @@ namespace OpenRA { WPos a; WVec b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call WPos.Add(WPos, WVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name)); return new LuaCustomClrObject(a + b); @@ -91,19 +91,19 @@ namespace OpenRA { WPos a; var rightType = right.WrappedClrType(); - if (!left.TryGetClrValue(out a)) + if (!left.TryGetClrValue(out a)) throw new LuaException("Attempted to call WPos.Subtract(WPos, WVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, rightType)); if (rightType == typeof(WPos)) { WPos b; - right.TryGetClrValue(out b); + right.TryGetClrValue(out b); return new LuaCustomClrObject(a - b); } else if (rightType == typeof(WVec)) { WVec b; - right.TryGetClrValue(out b); + right.TryGetClrValue(out b); return new LuaCustomClrObject(a - b); } @@ -113,7 +113,7 @@ namespace OpenRA public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right) { WPos a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) return false; return a == b; diff --git a/OpenRA.Game/WVec.cs b/OpenRA.Game/WVec.cs index 3e3106bf8c..6e774ceb18 100644 --- a/OpenRA.Game/WVec.cs +++ b/OpenRA.Game/WVec.cs @@ -82,7 +82,7 @@ namespace OpenRA // Add an additional quadratic variation to height // Uses fp to avoid integer overflow - var offset = (int)((float)((float)(b - a).Length * pitch.Tan() * mul * (div - mul)) / (float)(1024 * div * div)); + var offset = (int)((float)(b - a).Length * pitch.Tan() * mul * (div - mul) / (1024 * div * div)); return new WVec(ret.X, ret.Y, ret.Z + offset); } @@ -108,7 +108,7 @@ namespace OpenRA public LuaValue Add(LuaRuntime runtime, LuaValue left, LuaValue right) { WVec a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call WVec.Add(WVec, WVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name)); return new LuaCustomClrObject(a + b); @@ -117,7 +117,7 @@ namespace OpenRA public LuaValue Subtract(LuaRuntime runtime, LuaValue left, LuaValue right) { WVec a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) throw new LuaException("Attempted to call WVec.Subtract(WVec, WVec) with invalid arguments ({0}, {1})".F(left.WrappedClrType().Name, right.WrappedClrType().Name)); return new LuaCustomClrObject(a - b); @@ -131,7 +131,7 @@ namespace OpenRA public LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right) { WVec a, b; - if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) + if (!left.TryGetClrValue(out a) || !right.TryGetClrValue(out b)) return false; return a == b; diff --git a/OpenRA.Game/Widgets/RootWidget.cs b/OpenRA.Game/Widgets/RootWidget.cs index dad5b216b2..c6cabcbd68 100644 --- a/OpenRA.Game/Widgets/RootWidget.cs +++ b/OpenRA.Game/Widgets/RootWidget.cs @@ -33,7 +33,7 @@ namespace OpenRA.Widgets if (hk == Game.Settings.Keys.HideUserInterfaceKey) { - foreach (var child in this.Children) + foreach (var child in Children) child.Visible ^= true; return true; diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 410c11a161..70799ef4e7 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -503,7 +503,7 @@ namespace OpenRA.Widgets public Widget GetOrNull(string id) { - if (this.Id == id) + if (Id == id) return this; foreach (var child in Children) diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index 8d9e22100d..0035fffc80 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -14,7 +14,6 @@ using System.Linq; using OpenRA.Effects; using OpenRA.Graphics; using OpenRA.Orders; -using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Widgets @@ -37,7 +36,7 @@ namespace OpenRA.Widgets [ObjectCreator.UseCtor] public WorldInteractionControllerWidget(World world, WorldRenderer worldRenderer) { - this.World = world; + World = world; this.worldRenderer = worldRenderer; } diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index eab43ae99e..1a9149346d 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -196,7 +196,7 @@ namespace OpenRA public void LoadComplete(WorldRenderer wr) { // ScreenMap must be initialized before anything else - using (new Support.PerfTimer("ScreenMap.WorldLoaded")) + using (new PerfTimer("ScreenMap.WorldLoaded")) ScreenMap.WorldLoaded(this, wr); foreach (var wlh in WorldActor.TraitsImplementing()) @@ -205,7 +205,7 @@ namespace OpenRA if (wlh == ScreenMap) continue; - using (new Support.PerfTimer(wlh.GetType().Name + ".WorldLoaded")) + using (new PerfTimer(wlh.GetType().Name + ".WorldLoaded")) wlh.WorldLoaded(this, wr); } @@ -374,7 +374,7 @@ namespace OpenRA public IEnumerable ActorsHavingTrait(Func predicate) { - return TraitDict.ActorsHavingTrait(predicate); + return TraitDict.ActorsHavingTrait(predicate); } public void OnPlayerWinStateChanged(Player player) diff --git a/OpenRA.Game/WorldUtils.cs b/OpenRA.Game/WorldUtils.cs index c86e4d7919..90d4c6480d 100644 --- a/OpenRA.Game/WorldUtils.cs +++ b/OpenRA.Game/WorldUtils.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using OpenRA.GameRules; using OpenRA.Support; using OpenRA.Traits; diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs index 3590d8c823..dfd6611b4e 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs b/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs index a33d5b88df..9a7a105ac6 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithReloadingSpriteTurret.cs @@ -9,9 +9,7 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; -using OpenRA.Mods.Common.Graphics; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/AI/AttackOrFleeFuzzy.cs b/OpenRA.Mods.Common/AI/AttackOrFleeFuzzy.cs index 34978edbc4..63434fcb0c 100644 --- a/OpenRA.Mods.Common/AI/AttackOrFleeFuzzy.cs +++ b/OpenRA.Mods.Common/AI/AttackOrFleeFuzzy.cs @@ -160,10 +160,10 @@ namespace OpenRA.Mods.Common.AI public bool CanAttack(IEnumerable ownUnits, IEnumerable enemyUnits) { var inputValues = new Dictionary(); - inputValues.Add(fuzzyEngine.InputByName("OwnHealth"), (double)NormalizedHealth(ownUnits, 100)); - inputValues.Add(fuzzyEngine.InputByName("EnemyHealth"), (double)NormalizedHealth(enemyUnits, 100)); - inputValues.Add(fuzzyEngine.InputByName("RelativeAttackPower"), (double)RelativePower(ownUnits, enemyUnits)); - inputValues.Add(fuzzyEngine.InputByName("RelativeSpeed"), (double)RelativeSpeed(ownUnits, enemyUnits)); + inputValues.Add(fuzzyEngine.InputByName("OwnHealth"), NormalizedHealth(ownUnits, 100)); + inputValues.Add(fuzzyEngine.InputByName("EnemyHealth"), NormalizedHealth(enemyUnits, 100)); + inputValues.Add(fuzzyEngine.InputByName("RelativeAttackPower"), RelativePower(ownUnits, enemyUnits)); + inputValues.Add(fuzzyEngine.InputByName("RelativeSpeed"), RelativeSpeed(ownUnits, enemyUnits)); var result = fuzzyEngine.Calculate(inputValues); var attackChance = result[fuzzyEngine.OutputByName("AttackOrFlee")]; diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index d46be16375..fa21d57570 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -138,7 +138,7 @@ namespace OpenRA.Mods.Common.AI [Desc("Should the AI repair its buildings if damaged?")] public readonly bool ShouldRepairBuildings = true; - string IBotInfo.Name { get { return this.Name; } } + string IBotInfo.Name { get { return Name; } } [Desc("What units to the AI should build.", "What % of the total army must be this type of unit.")] public readonly Dictionary UnitsToBuild = null; @@ -245,7 +245,7 @@ namespace OpenRA.Mods.Common.AI public readonly World World; public Map Map { get { return World.Map; } } - IBotInfo IBot.Info { get { return this.Info; } } + IBotInfo IBot.Info { get { return Info; } } int rushTicks; int assignRolesTicks; diff --git a/OpenRA.Mods.Common/AI/SupportPowerDecision.cs b/OpenRA.Mods.Common/AI/SupportPowerDecision.cs index bd59c822e0..65d657198d 100644 --- a/OpenRA.Mods.Common/AI/SupportPowerDecision.cs +++ b/OpenRA.Mods.Common/AI/SupportPowerDecision.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Activities/Air/FallToEarth.cs b/OpenRA.Mods.Common/Activities/Air/FallToEarth.cs index 531ef2c312..774ae2f102 100644 --- a/OpenRA.Mods.Common/Activities/Air/FallToEarth.cs +++ b/OpenRA.Mods.Common/Activities/Air/FallToEarth.cs @@ -10,7 +10,6 @@ using System.Linq; using OpenRA.Activities; -using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs index 50aa09ffa6..842ca1afa3 100644 --- a/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Traits; diff --git a/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs b/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs index 324d041dfd..e961afeb3b 100644 --- a/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs +++ b/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs @@ -8,12 +8,9 @@ */ #endregion -using System; -using System.Collections.Generic; using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Traits; -using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities diff --git a/OpenRA.Mods.Common/Activities/Demolish.cs b/OpenRA.Mods.Common/Activities/Demolish.cs index 587ede8fcb..dd3c54d2dd 100644 --- a/OpenRA.Mods.Common/Activities/Demolish.cs +++ b/OpenRA.Mods.Common/Activities/Demolish.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Linq; using OpenRA.Effects; using OpenRA.Mods.Common.Traits; diff --git a/OpenRA.Mods.Common/Activities/Enter.cs b/OpenRA.Mods.Common/Activities/Enter.cs index 729e02f84f..f10fb91376 100644 --- a/OpenRA.Mods.Common/Activities/Enter.cs +++ b/OpenRA.Mods.Common/Activities/Enter.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Activities protected Enter(Actor self, Actor target, EnterBehaviour enterBehaviour, int maxTries = 1, bool targetCenter = false) { - this.move = self.Trait(); + move = self.Trait(); this.target = Target.FromActor(target); this.maxTries = maxTries; this.enterBehaviour = enterBehaviour; diff --git a/OpenRA.Mods.Common/Activities/FindResources.cs b/OpenRA.Mods.Common/Activities/FindResources.cs index 9d30fe01d7..cc2de5b390 100644 --- a/OpenRA.Mods.Common/Activities/FindResources.cs +++ b/OpenRA.Mods.Common/Activities/FindResources.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Pathfinder; using OpenRA.Mods.Common.Traits; diff --git a/OpenRA.Mods.Common/Activities/Move/Drag.cs b/OpenRA.Mods.Common/Activities/Move/Drag.cs index 96285bac56..61321c06bf 100644 --- a/OpenRA.Mods.Common/Activities/Move/Drag.cs +++ b/OpenRA.Mods.Common/Activities/Move/Drag.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Activities/Move/Move.cs b/OpenRA.Mods.Common/Activities/Move/Move.cs index 37e99bedfd..1721220b7c 100644 --- a/OpenRA.Mods.Common/Activities/Move/Move.cs +++ b/OpenRA.Mods.Common/Activities/Move/Move.cs @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Activities return path; }; this.destination = destination; - this.nearEnough = WDist.Zero; + nearEnough = WDist.Zero; } // HACK: for legacy code @@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Activities }; this.destination = destination; - this.nearEnough = WDist.Zero; + nearEnough = WDist.Zero; this.ignoredActor = ignoredActor; } diff --git a/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs b/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs index d99150f2a1..94dc28cd43 100644 --- a/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs +++ b/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.Linq; diff --git a/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs b/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs index 80bef9a5c0..08f3b6956c 100644 --- a/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs +++ b/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs @@ -10,8 +10,6 @@ using System.Collections.Generic; using System.Linq; -using OpenRA.Activities; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities diff --git a/OpenRA.Mods.Common/Activities/Transform.cs b/OpenRA.Mods.Common/Activities/Transform.cs index f3d2e0b723..8bfaadf4e0 100644 --- a/OpenRA.Mods.Common/Activities/Transform.cs +++ b/OpenRA.Mods.Common/Activities/Transform.cs @@ -12,7 +12,6 @@ using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { diff --git a/OpenRA.Mods.Common/Activities/Turn.cs b/OpenRA.Mods.Common/Activities/Turn.cs index c7096c7567..05aadcfffc 100644 --- a/OpenRA.Mods.Common/Activities/Turn.cs +++ b/OpenRA.Mods.Common/Activities/Turn.cs @@ -8,10 +8,7 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs index ad7e52e416..4de81e486a 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs @@ -8,19 +8,11 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Graphics; using OpenRA.Mods.Common.Traits; -using OpenRA.Orders; using OpenRA.Primitives; using OpenRA.Traits; -using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets { diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs index 12ce5d98ad..ad20e23c96 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs @@ -10,17 +10,9 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Graphics; using OpenRA.Mods.Common.Traits; -using OpenRA.Orders; -using OpenRA.Primitives; -using OpenRA.Traits; -using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets { diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs index 1f493d254e..2906e96675 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs @@ -10,17 +10,10 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Graphics; using OpenRA.Mods.Common.Traits; -using OpenRA.Orders; -using OpenRA.Primitives; using OpenRA.Traits; -using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets { diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs index 74c5d723a9..e350a05414 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorResourceBrush.cs @@ -8,19 +8,9 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.Common.Traits; -using OpenRA.Orders; -using OpenRA.Primitives; using OpenRA.Traits; -using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets { diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs index 737a9ea60e..b65385ea8d 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs @@ -8,19 +8,9 @@ */ #endregion -using System; -using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.Common.Traits; -using OpenRA.Orders; -using OpenRA.Primitives; -using OpenRA.Traits; -using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets { diff --git a/OpenRA.Mods.Common/Effects/AreaBeam.cs b/OpenRA.Mods.Common/Effects/AreaBeam.cs index 212844df39..fdfab6b91e 100644 --- a/OpenRA.Mods.Common/Effects/AreaBeam.cs +++ b/OpenRA.Mods.Common/Effects/AreaBeam.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.Effects; using OpenRA.GameRules; using OpenRA.Graphics; diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index 5a0cd1181d..16f7a2fb0e 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.Effects; using OpenRA.GameRules; using OpenRA.Graphics; @@ -100,7 +99,7 @@ namespace OpenRA.Mods.Common.Effects { this.info = info; this.args = args; - this.pos = args.Source; + pos = args.Source; var world = args.SourceActor.World; diff --git a/OpenRA.Mods.Common/Effects/FloatingText.cs b/OpenRA.Mods.Common/Effects/FloatingText.cs index ccea3138d9..b9519122f4 100644 --- a/OpenRA.Mods.Common/Effects/FloatingText.cs +++ b/OpenRA.Mods.Common/Effects/FloatingText.cs @@ -29,11 +29,11 @@ namespace OpenRA.Mods.Common.Effects public FloatingText(WPos pos, Color color, string text, int duration) { - this.font = Game.Renderer.Fonts["TinyBold"]; + font = Game.Renderer.Fonts["TinyBold"]; this.pos = pos; this.color = color; this.text = text; - this.remaining = duration; + remaining = duration; } public void Tick(World world) diff --git a/OpenRA.Mods.Common/Effects/LaserZap.cs b/OpenRA.Mods.Common/Effects/LaserZap.cs index 7b74912256..ea2814f708 100644 --- a/OpenRA.Mods.Common/Effects/LaserZap.cs +++ b/OpenRA.Mods.Common/Effects/LaserZap.cs @@ -68,10 +68,10 @@ namespace OpenRA.Mods.Common.Effects this.args = args; this.info = info; this.color = color; - this.target = args.PassiveTarget; + target = args.PassiveTarget; if (!string.IsNullOrEmpty(info.HitAnim)) - this.hitanim = new Animation(args.SourceActor.World, info.HitAnim); + hitanim = new Animation(args.SourceActor.World, info.HitAnim); } public void Tick(World world) diff --git a/OpenRA.Mods.Common/Effects/NukeLaunch.cs b/OpenRA.Mods.Common/Effects/NukeLaunch.cs index 8097289e4a..feece05e42 100644 --- a/OpenRA.Mods.Common/Effects/NukeLaunch.cs +++ b/OpenRA.Mods.Common/Effects/NukeLaunch.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Effects this.firedBy = firedBy; this.weapon = weapon; this.delay = delay; - this.turn = delay / 2; + turn = delay / 2; this.flashType = flashType; var offset = new WVec(WDist.Zero, WDist.Zero, velocity * turn); diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index 5594e01656..b008fa7fce 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -122,25 +122,25 @@ namespace OpenRA.Mods.Common.Graphics try { - Start = LoadField(d, "Start", 0); - ShadowStart = LoadField(d, "ShadowStart", -1); - ShadowZOffset = LoadField(d, "ShadowZOffset", DefaultShadowSpriteZOffset).Length; - ZOffset = LoadField(d, "ZOffset", WDist.Zero).Length; - Tick = LoadField(d, "Tick", 40); - transpose = LoadField(d, "Transpose", false); + Start = LoadField(d, "Start", 0); + ShadowStart = LoadField(d, "ShadowStart", -1); + ShadowZOffset = LoadField(d, "ShadowZOffset", DefaultShadowSpriteZOffset).Length; + ZOffset = LoadField(d, "ZOffset", WDist.Zero).Length; + Tick = LoadField(d, "Tick", 40); + transpose = LoadField(d, "Transpose", false); Frames = LoadField(d, "Frames", null); - var flipX = LoadField(d, "FlipX", false); - var flipY = LoadField(d, "FlipY", false); + var flipX = LoadField(d, "FlipX", false); + var flipY = LoadField(d, "FlipY", false); - Facings = LoadField(d, "Facings", 1); + Facings = LoadField(d, "Facings", 1); if (Facings < 0) { reverseFacings = true; Facings = -Facings; } - var offset = LoadField(d, "Offset", float2.Zero); - var blendMode = LoadField(d, "BlendMode", BlendMode.Alpha); + var offset = LoadField(d, "Offset", float2.Zero); + var blendMode = LoadField(d, "BlendMode", BlendMode.Alpha); MiniYaml combine; if (d.TryGetValue("Combine", out combine)) @@ -151,10 +151,10 @@ namespace OpenRA.Mods.Common.Graphics var sd = sub.Value.ToDictionary(); // Allow per-sprite offset, start, and length - var subStart = LoadField(sd, "Start", 0); - var subOffset = LoadField(sd, "Offset", float2.Zero); - var subFlipX = LoadField(sd, "FlipX", false); - var subFlipY = LoadField(sd, "FlipY", false); + var subStart = LoadField(sd, "Start", 0); + var subOffset = LoadField(sd, "Offset", float2.Zero); + var subFlipX = LoadField(sd, "FlipX", false); + var subFlipY = LoadField(sd, "FlipY", false); var subSrc = GetSpriteSrc(modData, tileSet, sequence, animation, sub.Key, sd); var subSprites = cache[subSrc].Select( @@ -165,7 +165,7 @@ namespace OpenRA.Mods.Common.Graphics if (sd.TryGetValue("Length", out subLengthYaml) && subLengthYaml.Value == "*") subLength = subSprites.Count() - subStart; else - subLength = LoadField(sd, "Length", 1); + subLength = LoadField(sd, "Length", 1); combined = combined.Concat(subSprites.Skip(subStart).Take(subLength)); } @@ -185,17 +185,17 @@ namespace OpenRA.Mods.Common.Graphics if (d.TryGetValue("Length", out length) && length.Value == "*") Length = sprites.Length - Start; else - Length = LoadField(d, "Length", 1); + Length = LoadField(d, "Length", 1); // Plays the animation forwards, and then in reverse - if (LoadField(d, "Reverses", false)) + if (LoadField(d, "Reverses", false)) { var frames = Frames ?? Exts.MakeArray(Length, i => Start + i); Frames = frames.Concat(frames.Skip(1).Take(frames.Length - 2).Reverse()).ToArray(); Length = 2 * Length - 2; } - Stride = LoadField(d, "Stride", Length); + Stride = LoadField(d, "Stride", Length); if (Length > Stride) throw new InvalidOperationException( diff --git a/OpenRA.Mods.Common/Graphics/DetectionCircleRenderable.cs b/OpenRA.Mods.Common/Graphics/DetectionCircleRenderable.cs index ef24eafc9b..dd7a6c396a 100644 --- a/OpenRA.Mods.Common/Graphics/DetectionCircleRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/DetectionCircleRenderable.cs @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Graphics this.centerPosition = centerPosition; this.radius = radius; this.zOffset = zOffset; - this.trailCount = lineTrails; + trailCount = lineTrails; this.trailSeparation = trailSeparation; this.trailAngle = trailAngle; this.color = color; diff --git a/OpenRA.Mods.Common/Graphics/RangeCircleRenderable.cs b/OpenRA.Mods.Common/Graphics/RangeCircleRenderable.cs index 8bfd6643b6..bd9ff265be 100644 --- a/OpenRA.Mods.Common/Graphics/RangeCircleRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/RangeCircleRenderable.cs @@ -55,10 +55,10 @@ namespace OpenRA.Mods.Common.Graphics { var wcr = Game.Renderer.WorldRgbaColorRenderer; var offset = new WVec(radius.Length, 0, 0); - for (var i = 0; i < RangeCircleRenderable.RangeCircleSegments; i++) + for (var i = 0; i < RangeCircleSegments; i++) { - var a = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleRenderable.RangeCircleStartRotations[i])); - var b = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleRenderable.RangeCircleEndRotations[i])); + var a = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleStartRotations[i])); + var b = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleEndRotations[i])); if (contrastWidth > 0) wcr.DrawLine(a, b, contrastWidth / wr.Viewport.Zoom, contrastColor); diff --git a/OpenRA.Mods.Common/Graphics/SelectionBoxRenderable.cs b/OpenRA.Mods.Common/Graphics/SelectionBoxRenderable.cs index 9c31ee6370..4ff6bd6561 100644 --- a/OpenRA.Mods.Common/Graphics/SelectionBoxRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/SelectionBoxRenderable.cs @@ -10,7 +10,6 @@ using System.Drawing; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Graphics { diff --git a/OpenRA.Mods.Common/Graphics/SpriteActorPreview.cs b/OpenRA.Mods.Common/Graphics/SpriteActorPreview.cs index d3d8ba2fda..7b7802bdd1 100644 --- a/OpenRA.Mods.Common/Graphics/SpriteActorPreview.cs +++ b/OpenRA.Mods.Common/Graphics/SpriteActorPreview.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Graphics; -using OpenRA.Primitives; namespace OpenRA.Mods.Common.Graphics { diff --git a/OpenRA.Mods.Common/Graphics/TilesetSpecificSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/TilesetSpecificSpriteSequence.cs index 97814dac92..26510a91c3 100644 --- a/OpenRA.Mods.Common/Graphics/TilesetSpecificSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/TilesetSpecificSpriteSequence.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Collections.Generic; -using System.IO; using System.Linq; using OpenRA.Graphics; @@ -69,16 +67,16 @@ namespace OpenRA.Mods.Common.Graphics var spriteName = sprite ?? sequence; - if (LoadField(d, "UseTilesetCode", false)) + if (LoadField(d, "UseTilesetCode", false)) { string code; if (loader.TilesetCodes.TryGetValue(ResolveTilesetId(tileSet, d), out code)) spriteName = spriteName.Substring(0, 1) + code + spriteName.Substring(2, spriteName.Length - 2); } - if (LoadField(d, "AddExtension", true)) + if (LoadField(d, "AddExtension", true)) { - var useTilesetExtension = LoadField(d, "UseTilesetExtension", false); + var useTilesetExtension = LoadField(d, "UseTilesetExtension", false); string tilesetExtension; if (useTilesetExtension && loader.TilesetExtensions.TryGetValue(ResolveTilesetId(tileSet, d), out tilesetExtension)) diff --git a/OpenRA.Mods.Common/Graphics/VoxelActorPreview.cs b/OpenRA.Mods.Common/Graphics/VoxelActorPreview.cs index 60f369cd94..084f1b9184 100644 --- a/OpenRA.Mods.Common/Graphics/VoxelActorPreview.cs +++ b/OpenRA.Mods.Common/Graphics/VoxelActorPreview.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Graphics; @@ -52,8 +51,8 @@ namespace OpenRA.Mods.Common.Graphics public IEnumerable Render(WorldRenderer wr, WPos pos) { - yield return new VoxelRenderable(components, pos + offset, zOffset, camera, this.scale, - lightSource, this.lightAmbientColor, this.lightDiffuseColor, + yield return new VoxelRenderable(components, pos + offset, zOffset, camera, scale, + lightSource, lightAmbientColor, lightDiffuseColor, colorPalette, normalsPalette, shadowPalette); } } diff --git a/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs b/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs index e8a32b4253..5268e46edc 100644 --- a/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs @@ -43,9 +43,9 @@ namespace OpenRA.Mods.Common.Graphics this.lightSource = lightSource; this.lightAmbientColor = lightAmbientColor; this.lightDiffuseColor = lightDiffuseColor; - this.palette = color; - this.normalsPalette = normals; - this.shadowPalette = shadow; + palette = color; + normalsPalette = normals; + shadowPalette = shadow; } public WPos Pos { get { return pos; } } @@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Graphics var draw = voxel.voxels.Where(v => v.DisableFunc == null || !v.DisableFunc()); renderProxy = Game.Renderer.WorldVoxelRenderer.RenderAsync( - wr, draw, voxel.camera, voxel.scale, VoxelRenderable.GroundNormal, voxel.lightSource, + wr, draw, voxel.camera, voxel.scale, GroundNormal, voxel.lightSource, voxel.lightAmbientColor, voxel.lightDiffuseColor, voxel.palette, voxel.normalsPalette, voxel.shadowPalette); } diff --git a/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs b/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs index 1bf7a38dcd..ae6d56172c 100644 --- a/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs +++ b/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs @@ -10,8 +10,6 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Reflection; using OpenRA.Traits; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs index 5299551817..f2a758489d 100644 --- a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs +++ b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Lint/CheckMapCordon.cs b/OpenRA.Mods.Common/Lint/CheckMapCordon.cs index 7cdd24c19b..18a7fddf4c 100644 --- a/OpenRA.Mods.Common/Lint/CheckMapCordon.cs +++ b/OpenRA.Mods.Common/Lint/CheckMapCordon.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint diff --git a/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs b/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs index 40123a4f20..359c6c9eac 100644 --- a/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs +++ b/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint diff --git a/OpenRA.Mods.Common/Lint/CheckPalettes.cs b/OpenRA.Mods.Common/Lint/CheckPalettes.cs index af4d4efe10..16b69734ba 100644 --- a/OpenRA.Mods.Common/Lint/CheckPalettes.cs +++ b/OpenRA.Mods.Common/Lint/CheckPalettes.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint diff --git a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs index 241f96a9c3..3850a48f1f 100644 --- a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs +++ b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Lint/CheckSequences.cs b/OpenRA.Mods.Common/Lint/CheckSequences.cs index dc7e3386f5..c41dd8a6aa 100644 --- a/OpenRA.Mods.Common/Lint/CheckSequences.cs +++ b/OpenRA.Mods.Common/Lint/CheckSequences.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs b/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs index 9ac4f990e5..e9d12ac584 100644 --- a/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs +++ b/OpenRA.Mods.Common/Lint/CheckTargetHealthRadius.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.GameRules; using OpenRA.Mods.Common.Effects; using OpenRA.Mods.Common.Traits; using OpenRA.Mods.Common.Warheads; diff --git a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs index 04181f95d2..bc355aa054 100644 --- a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using System.Reflection; using OpenRA.Traits; namespace OpenRA.Mods.Common.Lint diff --git a/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs b/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs index 1c11bd2745..231d3552b8 100644 --- a/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs +++ b/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Mods.Common.Widgets.Logic; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Orders/DeployOrderTargeter.cs b/OpenRA.Mods.Common/Orders/DeployOrderTargeter.cs index da6b8818fd..96a9d75780 100644 --- a/OpenRA.Mods.Common/Orders/DeployOrderTargeter.cs +++ b/OpenRA.Mods.Common/Orders/DeployOrderTargeter.cs @@ -25,8 +25,8 @@ namespace OpenRA.Mods.Common.Orders public DeployOrderTargeter(string order, int priority, Func cursor) { - this.OrderID = order; - this.OrderPriority = priority; + OrderID = order; + OrderPriority = priority; this.cursor = cursor; } diff --git a/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs b/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs index 5aa7b3f295..4cee0ed06f 100644 --- a/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Orders { diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index a81b295f7f..dff98deb88 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -12,11 +12,9 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Graphics; using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; -using OpenRA.Traits; using Util = OpenRA.Traits.Util; namespace OpenRA.Mods.Common.Orders diff --git a/OpenRA.Mods.Common/Orders/UnitOrderTargeter.cs b/OpenRA.Mods.Common/Orders/UnitOrderTargeter.cs index 8de25c8889..fdbdfaf0d1 100644 --- a/OpenRA.Mods.Common/Orders/UnitOrderTargeter.cs +++ b/OpenRA.Mods.Common/Orders/UnitOrderTargeter.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Orders @@ -21,8 +20,8 @@ namespace OpenRA.Mods.Common.Orders public UnitOrderTargeter(string order, int priority, string cursor, bool targetEnemyUnits, bool targetAllyUnits) { - this.OrderID = order; - this.OrderPriority = priority; + OrderID = order; + OrderPriority = priority; this.cursor = cursor; this.targetEnemyUnits = targetEnemyUnits; this.targetAllyUnits = targetAllyUnits; diff --git a/OpenRA.Mods.Common/Pathfinder/BasePathSearch.cs b/OpenRA.Mods.Common/Pathfinder/BasePathSearch.cs index ff680d74aa..a096c8e0a8 100644 --- a/OpenRA.Mods.Common/Pathfinder/BasePathSearch.cs +++ b/OpenRA.Mods.Common/Pathfinder/BasePathSearch.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Text; using OpenRA.Primitives; namespace OpenRA.Mods.Common.Pathfinder diff --git a/OpenRA.Mods.Common/Pathfinder/CellInfo.cs b/OpenRA.Mods.Common/Pathfinder/CellInfo.cs index a8112bc343..5c4f38afc7 100644 --- a/OpenRA.Mods.Common/Pathfinder/CellInfo.cs +++ b/OpenRA.Mods.Common/Pathfinder/CellInfo.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; - namespace OpenRA.Mods.Common.Pathfinder { /// diff --git a/OpenRA.Mods.Common/Scripting/CallLuaFunc.cs b/OpenRA.Mods.Common/Scripting/CallLuaFunc.cs index 844a30c6d6..509a27cdb6 100644 --- a/OpenRA.Mods.Common/Scripting/CallLuaFunc.cs +++ b/OpenRA.Mods.Common/Scripting/CallLuaFunc.cs @@ -12,7 +12,6 @@ using System; using Eluant; using OpenRA.Activities; using OpenRA.Scripting; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Activities { diff --git a/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs index d1cdfa2553..84f1e423be 100644 --- a/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Mods.Common.Effects; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; diff --git a/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs index da58c156dc..0f13b00717 100644 --- a/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs @@ -9,7 +9,6 @@ #endregion using System; -using Eluant; using OpenRA.Scripting; namespace OpenRA.Mods.Common.Scripting diff --git a/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs index 6b49bfd0d7..4f4124adf4 100644 --- a/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; using Eluant; using OpenRA.Effects; diff --git a/OpenRA.Mods.Common/Scripting/LuaScript.cs b/OpenRA.Mods.Common/Scripting/LuaScript.cs index 56e23c39a0..c9a54229b2 100644 --- a/OpenRA.Mods.Common/Scripting/LuaScript.cs +++ b/OpenRA.Mods.Common/Scripting/LuaScript.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; diff --git a/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs index 2c745413ca..5091afe68d 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/AirstrikeProperties.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using Eluant; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Scripting/Properties/CaptureProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/CaptureProperties.cs index 732c274fab..4063d8be89 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/CaptureProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/CaptureProperties.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using Eluant; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; diff --git a/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs index cdfaac470c..c5632ee921 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/CombatProperties.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Linq; using Eluant; using OpenRA.Activities; diff --git a/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs index 162686aae4..674ad2cc4c 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs @@ -8,10 +8,6 @@ */ #endregion -using System; -using System.Linq; -using Eluant; -using OpenRA.Activities; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; diff --git a/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs index 9bfb999c05..96f5a88909 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using Eluant; -using OpenRA.Network; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Scripting/Properties/MissionObjectiveProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/MissionObjectiveProperties.cs index 61c3e7c9b6..e49fde48f3 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/MissionObjectiveProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/MissionObjectiveProperties.cs @@ -8,11 +8,9 @@ */ #endregion -using System; using Eluant; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Scripting { diff --git a/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs index 2e335c06c9..ab8d1d0876 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using Eluant; diff --git a/OpenRA.Mods.Common/Scripting/Properties/PowerProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/PowerProperties.cs index 450ec40076..ad7422ea3e 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/PowerProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/PowerProperties.cs @@ -8,10 +8,7 @@ */ #endregion -using System; -using System.Collections.Generic; using System.Linq; -using Eluant; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs index 5f3fa10b81..2772654720 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Linq; using Eluant; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.Common.Scripting; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs index c0d016b38b..54881d8c6d 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs @@ -10,7 +10,6 @@ using System; using System.IO; -using System.Linq; using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs b/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs index 6cfcd5e8b7..d6f4ef4814 100644 --- a/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs +++ b/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Graphics; -using OpenRA.Network; using OpenRA.Server; using S = OpenRA.Server.Server; @@ -199,7 +198,7 @@ namespace OpenRA.Mods.Common.Server // Validate whether color is allowed and get an alternative if it isn't if (client.Slot == null || !server.LobbyInfo.Slots[client.Slot].LockColor) - client.Color = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index); + client.Color = ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index); } #endregion diff --git a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs index 0c60aab18e..d7fb45dad1 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; @@ -760,7 +759,7 @@ namespace OpenRA.Mods.Common.Server { "name", s => { - var sanitizedName = OpenRA.Settings.SanitizedPlayerName(s); + var sanitizedName = Settings.SanitizedPlayerName(s); if (sanitizedName == client.Name) return true; diff --git a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs index 0d8ddd2b85..3426c866c5 100644 --- a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Linq; using OpenRA.Server; using S = OpenRA.Server.Server; diff --git a/OpenRA.Mods.Common/Traits/AffectsShroud.cs b/OpenRA.Mods.Common/Traits/AffectsShroud.cs index 4f0a84884b..e330bffa97 100644 --- a/OpenRA.Mods.Common/Traits/AffectsShroud.cs +++ b/OpenRA.Mods.Common/Traits/AffectsShroud.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Linq; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs index f233ba7cb5..7c459bf3a3 100644 --- a/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs +++ b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.GameRules; using OpenRA.Mods.Common.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Armor.cs b/OpenRA.Mods.Common/Traits/Armor.cs index e637ff52a1..ad06b93c68 100644 --- a/OpenRA.Mods.Common/Traits/Armor.cs +++ b/OpenRA.Mods.Common/Traits/Armor.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Traits; - namespace OpenRA.Mods.Common.Traits { [Desc("Used to define weapon efficiency modifiers with different percentages per Type.")] diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs index f375a35257..042e04105b 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs @@ -305,8 +305,8 @@ namespace OpenRA.Mods.Common.Traits public AttackOrderTargeter(AttackBase ab, int priority, bool negativeDamage) { this.ab = ab; - this.OrderID = ab.attackOrderName; - this.OrderPriority = priority; + OrderID = ab.attackOrderName; + OrderPriority = priority; } public string OrderID { get; private set; } diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs b/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs index 976946629d..ca088c5ba0 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenRA.Activities; using OpenRA.Graphics; using OpenRA.Traits; @@ -82,7 +81,7 @@ namespace OpenRA.Mods.Common.Traits public AttackGarrisoned(Actor self, AttackGarrisonedInfo info) : base(self, info) { - this.Info = info; + Info = info; coords = Exts.Lazy(() => self.Trait()); armaments = new List(); muzzles = new List(); diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackSuicides.cs b/OpenRA.Mods.Common/Traits/Attack/AttackSuicides.cs index 3674496e5e..177f72e4f3 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackSuicides.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackSuicides.cs @@ -11,8 +11,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Activities; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs b/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs index c86cc3cdbb..f96c479268 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs @@ -8,9 +8,7 @@ */ #endregion -using System.Collections.Generic; using System.Linq; -using OpenRA.Activities; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index 11bf3058a2..0a420da7c1 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; using OpenRA.Mods.Common.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs b/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs index 7f599b8db2..6ca63a390a 100644 --- a/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs +++ b/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { diff --git a/OpenRA.Mods.Common/Traits/BodyOrientation.cs b/OpenRA.Mods.Common/Traits/BodyOrientation.cs index 8e9b171ff0..e7a8287ed4 100644 --- a/OpenRA.Mods.Common/Traits/BodyOrientation.cs +++ b/OpenRA.Mods.Common/Traits/BodyOrientation.cs @@ -9,8 +9,6 @@ #endregion using System; -using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Buildings/Building.cs b/OpenRA.Mods.Common/Traits/Buildings/Building.cs index 55ab552366..00eb6e3449 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Building.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Building.cs @@ -154,9 +154,9 @@ namespace OpenRA.Mods.Common.Traits public Building(ActorInitializer init, BuildingInfo info) { - this.self = init.Self; - this.topLeft = init.Get(); - this.Info = info; + self = init.Self; + topLeft = init.Get(); + Info = info; occupiedCells = FootprintUtils.UnpathableTiles(self.Info.Name, Info, TopLeft) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); diff --git a/OpenRA.Mods.Common/Traits/Buildings/BuildingUtils.cs b/OpenRA.Mods.Common/Traits/Buildings/BuildingUtils.cs index 80fd1af5c9..ca10c021dc 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/BuildingUtils.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/BuildingUtils.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Linq; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { diff --git a/OpenRA.Mods.Common/Traits/Buildings/Exit.cs b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs index c03ffcd0fe..b83f221a36 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Exit.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Collections.Generic; -using OpenRA.Mods.Common.Effects; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs b/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs index c369b8ea38..3a249dea67 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits { public static IEnumerable Tiles(Ruleset rules, string name, BuildingInfo buildingInfo, CPos topLeft) { - var dim = (CVec)buildingInfo.Dimensions; + var dim = buildingInfo.Dimensions; var footprint = buildingInfo.Footprint.Where(x => !char.IsWhiteSpace(x)); @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits 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')) + foreach (var tile in TilesWhere(name, buildingInfo.Dimensions, footprint, a => a == 'x')) yield return tile + position; } diff --git a/OpenRA.Mods.Common/Traits/Capturable.cs b/OpenRA.Mods.Common/Traits/Capturable.cs index 7076b72060..11db6d1686 100644 --- a/OpenRA.Mods.Common/Traits/Capturable.cs +++ b/OpenRA.Mods.Common/Traits/Capturable.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Crates/Crate.cs b/OpenRA.Mods.Common/Traits/Crates/Crate.cs index 4acbbfcaa4..58c62d43cb 100644 --- a/OpenRA.Mods.Common/Traits/Crates/Crate.cs +++ b/OpenRA.Mods.Common/Traits/Crates/Crate.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits public Crate(ActorInitializer init, CrateInfo info) { - this.self = init.Self; + self = init.Self; this.info = info; if (init.Contains()) diff --git a/OpenRA.Mods.Common/Traits/Crates/HealUnitsCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/HealUnitsCrateAction.cs index d228eb0cd6..0aef3941d0 100644 --- a/OpenRA.Mods.Common/Traits/Crates/HealUnitsCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/HealUnitsCrateAction.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { diff --git a/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs index e50d1166bf..99a6cd600c 100644 --- a/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs @@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits { var gainsExperience = recipient.TraitOrDefault(); if (gainsExperience != null) - gainsExperience.GiveLevels(((LevelUpCrateActionInfo)info).Levels); + gainsExperience.GiveLevels(info.Levels); }); } diff --git a/OpenRA.Mods.Common/Traits/CustomSelectionSize.cs b/OpenRA.Mods.Common/Traits/CustomSelectionSize.cs index e33f3bb0a9..13de71903b 100644 --- a/OpenRA.Mods.Common/Traits/CustomSelectionSize.cs +++ b/OpenRA.Mods.Common/Traits/CustomSelectionSize.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Explodes.cs b/OpenRA.Mods.Common/Traits/Explodes.cs index 2c423c6adf..b34b246828 100644 --- a/OpenRA.Mods.Common/Traits/Explodes.cs +++ b/OpenRA.Mods.Common/Traits/Explodes.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.GameRules; diff --git a/OpenRA.Mods.Common/Traits/ExternalCapturable.cs b/OpenRA.Mods.Common/Traits/ExternalCapturable.cs index 7d8f658356..e35bd2182e 100644 --- a/OpenRA.Mods.Common/Traits/ExternalCapturable.cs +++ b/OpenRA.Mods.Common/Traits/ExternalCapturable.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/GivesBounty.cs b/OpenRA.Mods.Common/Traits/GivesBounty.cs index 8231f8239e..af2e9d0aa0 100644 --- a/OpenRA.Mods.Common/Traits/GivesBounty.cs +++ b/OpenRA.Mods.Common/Traits/GivesBounty.cs @@ -10,7 +10,6 @@ using System.Linq; using OpenRA.Mods.Common.Effects; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Guard.cs b/OpenRA.Mods.Common/Traits/Guard.cs index 34ed23a53d..f2541eb66a 100644 --- a/OpenRA.Mods.Common/Traits/Guard.cs +++ b/OpenRA.Mods.Common/Traits/Guard.cs @@ -8,13 +8,8 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using OpenRA.Graphics; -using OpenRA.Mods.Common; using OpenRA.Mods.Common.Activities; -using OpenRA.Orders; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Health.cs b/OpenRA.Mods.Common/Traits/Health.cs index 0eaf6d65ba..f984b55e73 100644 --- a/OpenRA.Mods.Common/Traits/Health.cs +++ b/OpenRA.Mods.Common/Traits/Health.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Linq; using OpenRA.Mods.Common.HitShapes; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Husk.cs b/OpenRA.Mods.Common/Traits/Husk.cs index 766137de28..1002b01d55 100644 --- a/OpenRA.Mods.Common/Traits/Husk.cs +++ b/OpenRA.Mods.Common/Traits/Husk.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits public Husk(ActorInitializer init, HuskInfo info) { this.info = info; - this.self = init.Self; + self = init.Self; TopLeft = init.Get(); CenterPosition = init.Contains() ? init.Get() : init.World.Map.CenterOfCell(TopLeft); diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 8f62509453..668c060235 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.Common; using OpenRA.Mods.Common.Activities; using OpenRA.Primitives; using OpenRA.Traits; @@ -84,7 +83,7 @@ namespace OpenRA.Mods.Common.Traits var nodesDict = t.Value.ToDictionary(); var cost = nodesDict.ContainsKey("PathingCost") ? FieldLoader.GetValue("cost", nodesDict["PathingCost"].Value) - : (int)(10000 / speed); + : 10000 / speed; ret.Add(t.Key, new TerrainInfo(speed, cost)); } @@ -369,7 +368,7 @@ namespace OpenRA.Mods.Common.Traits SetVisualPosition(self, init.World.Map.CenterOfSubCell(FromCell, FromSubCell)); } - this.Facing = init.Contains() ? init.Get() : info.InitialFacing; + Facing = init.Contains() ? init.Get() : info.InitialFacing; // Sets the visual position to WPos accuracy // Use LocationInit if you want to insert the actor into the ActorMap! @@ -704,7 +703,7 @@ namespace OpenRA.Mods.Common.Traits public MoveOrderTargeter(Actor self, Mobile unit) { - this.mobile = unit; + mobile = unit; rejectMove = !self.AcceptsOrder("Move"); } diff --git a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs index 969a644c5b..dc80d4622a 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; diff --git a/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderFog.cs b/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderFog.cs index f04d6111e7..54a6ae3570 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderFog.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderFog.cs @@ -8,11 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; -using OpenRA.Graphics; -using OpenRA.Traits; - namespace OpenRA.Mods.Common.Traits { [Desc("The actor stays invisible under fog of war.")] diff --git a/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderShroud.cs b/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderShroud.cs index 75e4a6960e..72abaa0195 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderShroud.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/HiddenUnderShroud.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs b/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs index 17ec29be1d..2e87fac576 100644 --- a/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs +++ b/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.GameRules; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Multipliers/RangeMultiplier.cs b/OpenRA.Mods.Common/Traits/Multipliers/RangeMultiplier.cs index 4995bd0665..1e2123a1ac 100644 --- a/OpenRA.Mods.Common/Traits/Multipliers/RangeMultiplier.cs +++ b/OpenRA.Mods.Common/Traits/Multipliers/RangeMultiplier.cs @@ -8,10 +8,6 @@ */ #endregion -using System; -using System.Linq; -using OpenRA; -using OpenRA.GameRules; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/PaletteEffects/CloakPaletteEffect.cs b/OpenRA.Mods.Common/Traits/PaletteEffects/CloakPaletteEffect.cs index 8904d0a960..14359d8a3d 100644 --- a/OpenRA.Mods.Common/Traits/PaletteEffects/CloakPaletteEffect.cs +++ b/OpenRA.Mods.Common/Traits/PaletteEffects/CloakPaletteEffect.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/PaletteEffects/MenuPaletteEffect.cs b/OpenRA.Mods.Common/Traits/PaletteEffects/MenuPaletteEffect.cs index 4087520b6e..330537750b 100644 --- a/OpenRA.Mods.Common/Traits/PaletteEffects/MenuPaletteEffect.cs +++ b/OpenRA.Mods.Common/Traits/PaletteEffects/MenuPaletteEffect.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Parachutable.cs b/OpenRA.Mods.Common/Traits/Parachutable.cs index e5a92f90fe..43f785ad97 100644 --- a/OpenRA.Mods.Common/Traits/Parachutable.cs +++ b/OpenRA.Mods.Common/Traits/Parachutable.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits public Parachutable(ActorInitializer init, ParachutableInfo info) { - this.self = init.Self; + self = init.Self; this.info = info; positionable = self.TraitOrDefault(); diff --git a/OpenRA.Mods.Common/Traits/Passenger.cs b/OpenRA.Mods.Common/Traits/Passenger.cs index 3f48b2a837..757f562919 100644 --- a/OpenRA.Mods.Common/Traits/Passenger.cs +++ b/OpenRA.Mods.Common/Traits/Passenger.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Player/ClassicProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ClassicProductionQueue.cs index 7d91af2158..876e238474 100644 --- a/OpenRA.Mods.Common/Traits/Player/ClassicProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ClassicProductionQueue.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits public ClassicProductionQueue(ActorInitializer init, ClassicProductionQueueInfo info) : base(init, init.Self, info) { - this.self = init.Self; + self = init.Self; this.info = info; } diff --git a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs index 8f3a5514b4..f50eb657cc 100644 --- a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs +++ b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs index 8a6337f40e..8318528e8c 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Linq; using OpenRA.Effects; using OpenRA.Primitives; diff --git a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs index 76035ea867..7463cbcc25 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs b/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs index 9065fb9047..ad40cb5eeb 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { @@ -41,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits { this.info = info; var tech = init.World.Map.Options.TechLevel ?? init.World.LobbyInfo.GlobalSettings.TechLevel; - this.enabled = info.Name == tech; + enabled = info.Name == tech; } } } diff --git a/OpenRA.Mods.Common/Traits/Player/TechTree.cs b/OpenRA.Mods.Common/Traits/Player/TechTree.cs index 5a471cc168..73387d3bc5 100644 --- a/OpenRA.Mods.Common/Traits/Player/TechTree.cs +++ b/OpenRA.Mods.Common/Traits/Player/TechTree.cs @@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits public bool HasPrerequisites(IEnumerable prerequisites) { - var ownedPrereqs = TechTree.GatherOwnedPrerequisites(player); + var ownedPrereqs = GatherOwnedPrerequisites(player); return prerequisites.All(p => !(p.Replace("~", "").StartsWith("!") ^ !ownedPrereqs.ContainsKey(p.Replace("!", "").Replace("~", "")))); } @@ -119,12 +119,12 @@ namespace OpenRA.Mods.Common.Traits public Watcher(string key, string[] prerequisites, int limit, ITechTreeElement watcher) { - this.Key = key; + Key = key; this.prerequisites = prerequisites; this.watcher = watcher; - this.hasPrerequisites = false; + hasPrerequisites = false; this.limit = limit; - this.hidden = false; + hidden = false; } bool HasPrerequisites(Cache> ownedPrerequisites) diff --git a/OpenRA.Mods.Common/Traits/Plug.cs b/OpenRA.Mods.Common/Traits/Plug.cs index 9d69c35749..eab8f0110c 100644 --- a/OpenRA.Mods.Common/Traits/Plug.cs +++ b/OpenRA.Mods.Common/Traits/Plug.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Production.cs b/OpenRA.Mods.Common/Traits/Production.cs index 599f261b5f..a919df922e 100644 --- a/OpenRA.Mods.Common/Traits/Production.cs +++ b/OpenRA.Mods.Common/Traits/Production.cs @@ -11,7 +11,6 @@ using System; using System.Drawing; using System.Linq; -using OpenRA.Activities; using OpenRA.Mods.Common.Activities; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/ProximityCaptor.cs b/OpenRA.Mods.Common/Traits/ProximityCaptor.cs index 92f39b3487..b4203c99a0 100644 --- a/OpenRA.Mods.Common/Traits/ProximityCaptor.cs +++ b/OpenRA.Mods.Common/Traits/ProximityCaptor.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/QuantizeFacingsFromSequence.cs b/OpenRA.Mods.Common/Traits/QuantizeFacingsFromSequence.cs index 59ee4e502d..2035c8402b 100644 --- a/OpenRA.Mods.Common/Traits/QuantizeFacingsFromSequence.cs +++ b/OpenRA.Mods.Common/Traits/QuantizeFacingsFromSequence.cs @@ -9,10 +9,7 @@ #endregion using System; -using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/AutoSelectionSize.cs b/OpenRA.Mods.Common/Traits/Render/AutoSelectionSize.cs index 0dc6288f91..53a5caf405 100644 --- a/OpenRA.Mods.Common/Traits/Render/AutoSelectionSize.cs +++ b/OpenRA.Mods.Common/Traits/Render/AutoSelectionSize.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/Hovers.cs b/OpenRA.Mods.Common/Traits/Render/Hovers.cs index 0459424e0b..7816237ecf 100644 --- a/OpenRA.Mods.Common/Traits/Render/Hovers.cs +++ b/OpenRA.Mods.Common/Traits/Render/Hovers.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Activities; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs index 6287644c71..9dd07762be 100644 --- a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs +++ b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Effects; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderUtils.cs b/OpenRA.Mods.Common/Traits/Render/RenderUtils.cs index 6632719ecb..245d10bd1b 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderUtils.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderUtils.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Traits; - namespace OpenRA.Mods.Common.Traits { public class RenderUtils diff --git a/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs b/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs index 58ae1669a9..95e65a80a1 100644 --- a/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Drawing; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs index 1689a998f8..de39214c40 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Mods.Common.Effects; diff --git a/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs b/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs index 681840406e..9f4d7c25b6 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs index d82cb75f52..8219a7de11 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; diff --git a/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs index bf6ec6cf4c..850f796fb6 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs @@ -8,9 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; -using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs index 32b2cba906..7c0e87acb6 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs index b502c6584a..ad0b27939d 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs @@ -8,11 +8,7 @@ */ #endregion -using System; -using System.Linq; using OpenRA.Activities; -using OpenRA.Graphics; -using OpenRA.Mods.Common.Activities; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs index 50517f9532..75dd3863fd 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs index 6042ca0c59..5fb5e2d606 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMuzzleOverlay.cs @@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Traits if (turreted != null) getFacing = () => turreted.TurretFacing; else if (facing != null) - getFacing = (Func)(() => facing.Facing); + getFacing = () => facing.Facing; else getFacing = () => 0; diff --git a/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs index c5e9342f5a..1fcccbbe2b 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs index 0d09674917..d72159e548 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Effects; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Render/WithShadow.cs b/OpenRA.Mods.Common/Traits/Render/WithShadow.cs index 5fdfe7685e..4ca045b587 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithShadow.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithShadow.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; diff --git a/OpenRA.Mods.Common/Traits/Render/WithSiloAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithSiloAnimation.cs index 9f029dc794..bed1956eec 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSiloAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSiloAnimation.cs @@ -8,9 +8,6 @@ */ #endregion -using System.Collections.Generic; -using OpenRA.Graphics; -using OpenRA.Mods.Common.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteRotorOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteRotorOverlay.cs index c5b221532e..624258e9cc 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteRotorOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteRotorOverlay.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; diff --git a/OpenRA.Mods.Common/Traits/RepairableNear.cs b/OpenRA.Mods.Common/Traits/RepairableNear.cs index 77dace723b..a48bebf42c 100644 --- a/OpenRA.Mods.Common/Traits/RepairableNear.cs +++ b/OpenRA.Mods.Common/Traits/RepairableNear.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/SeedsResource.cs b/OpenRA.Mods.Common/Traits/SeedsResource.cs index 89aad58a7c..945cd4293a 100644 --- a/OpenRA.Mods.Common/Traits/SeedsResource.cs +++ b/OpenRA.Mods.Common/Traits/SeedsResource.cs @@ -9,9 +9,7 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; -using OpenRA.Support; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/SelfHealing.cs b/OpenRA.Mods.Common/Traits/SelfHealing.cs index bb4986725b..f41e31af77 100644 --- a/OpenRA.Mods.Common/Traits/SelfHealing.cs +++ b/OpenRA.Mods.Common/Traits/SelfHealing.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Sellable.cs b/OpenRA.Mods.Common/Traits/Sellable.cs index 90f0c16d6c..9cefe5ffcc 100644 --- a/OpenRA.Mods.Common/Traits/Sellable.cs +++ b/OpenRA.Mods.Common/Traits/Sellable.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Linq; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs b/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs index bc16292fb1..e629662e9b 100644 --- a/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs +++ b/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Mods.Common.Warheads; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Sound/SoundOnDamageTransition.cs b/OpenRA.Mods.Common/Traits/Sound/SoundOnDamageTransition.cs index 75f738c78b..d26be6021e 100644 --- a/OpenRA.Mods.Common/Traits/Sound/SoundOnDamageTransition.cs +++ b/OpenRA.Mods.Common/Traits/Sound/SoundOnDamageTransition.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Support; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs b/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs index a8acbe4aa1..bb69ece846 100644 --- a/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs +++ b/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Linq; using OpenRA.Mods.Common.Warheads; using OpenRA.Primitives; diff --git a/OpenRA.Mods.Common/Traits/StoresResources.cs b/OpenRA.Mods.Common/Traits/StoresResources.cs index 190abee811..7b2c5f7c8b 100644 --- a/OpenRA.Mods.Common/Traits/StoresResources.cs +++ b/OpenRA.Mods.Common/Traits/StoresResources.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs index 3876f7bade..00741b47c6 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Effects; -using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs index 4b2cf10e46..8fdea96c19 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs @@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Traits this.manager = manager; this.order = order; this.power = power; - this.range = power.info.Range; + range = power.info.Range; tile = world.Map.SequenceProvider.GetSequence("overlay", "target-select").GetSprite(0); } diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs index d704651789..1c70ca35e7 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SpawnActorPower.cs @@ -10,7 +10,6 @@ using OpenRA.Effects; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.Common.Effects; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Turreted.cs b/OpenRA.Mods.Common/Traits/Turreted.cs index dcfed15143..c23ae24c35 100644 --- a/OpenRA.Mods.Common/Traits/Turreted.cs +++ b/OpenRA.Mods.Common/Traits/Turreted.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs b/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs index 75fa0a5474..e5f398afa4 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits public DeployToUpgrade(ActorInitializer init, DeployToUpgradeInfo info) { - this.self = init.Self; + self = init.Self; this.info = info; manager = self.Trait(); checkTerrainType = info.AllowedTerrainTypes.Count > 0; diff --git a/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs b/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs index 8783aae9e6..d1c2d3f410 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Upgrades/UpgradeActorsNear.cs b/OpenRA.Mods.Common/Traits/Upgrades/UpgradeActorsNear.cs index 57f5fbc324..e17e80e24a 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/UpgradeActorsNear.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/UpgradeActorsNear.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; -using OpenRA.GameRules; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs b/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs index 72d6ca5fcc..da6b2e183a 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs @@ -10,10 +10,7 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; -using OpenRA.Graphics; -using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/Voiced.cs b/OpenRA.Mods.Common/Traits/Voiced.cs index c683e39ae6..343e04df53 100644 --- a/OpenRA.Mods.Common/Traits/Voiced.cs +++ b/OpenRA.Mods.Common/Traits/Voiced.cs @@ -8,9 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; -using OpenRA.GameRules; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs b/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs index e6cb7d33be..56df270a66 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs @@ -11,10 +11,8 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.IO; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Graphics; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs index 5ff4bb1618..b5d922dc7b 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits { ID = id; this.actor = actor; - this.Owner = owner; + Owner = owner; this.worldRenderer = worldRenderer; if (!actor.InitDict.Contains()) diff --git a/OpenRA.Mods.Common/Traits/World/EditorResourceLayer.cs b/OpenRA.Mods.Common/Traits/World/EditorResourceLayer.cs index 9a1264fc8a..163c1d7b56 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorResourceLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorResourceLayer.cs @@ -10,12 +10,9 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.IO; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Graphics; -using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs b/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs index 396380577d..6088dc10a6 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs @@ -8,14 +8,7 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Graphics; -using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/World/LoadWidgetAtGameStart.cs b/OpenRA.Mods.Common/Traits/World/LoadWidgetAtGameStart.cs index 75462811b8..30c7e5fd48 100644 --- a/OpenRA.Mods.Common/Traits/World/LoadWidgetAtGameStart.cs +++ b/OpenRA.Mods.Common/Traits/World/LoadWidgetAtGameStart.cs @@ -9,7 +9,6 @@ #endregion using OpenRA.Graphics; -using OpenRA.Mods.Common.Widgets; using OpenRA.Traits; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Traits/World/PaletteFromPaletteWithAlpha.cs b/OpenRA.Mods.Common/Traits/World/PaletteFromPaletteWithAlpha.cs index a7e96b2998..e5c92b134f 100644 --- a/OpenRA.Mods.Common/Traits/World/PaletteFromPaletteWithAlpha.cs +++ b/OpenRA.Mods.Common/Traits/World/PaletteFromPaletteWithAlpha.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/World/PaletteFromPlayerPaletteWithAlpha.cs b/OpenRA.Mods.Common/Traits/World/PaletteFromPlayerPaletteWithAlpha.cs index fc19d01bac..f60512f607 100644 --- a/OpenRA.Mods.Common/Traits/World/PaletteFromPlayerPaletteWithAlpha.cs +++ b/OpenRA.Mods.Common/Traits/World/PaletteFromPlayerPaletteWithAlpha.cs @@ -8,10 +8,7 @@ */ #endregion -using System.Collections.Generic; -using System.Drawing; using OpenRA.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs index c2486cf033..4c555579e2 100644 --- a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs +++ b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs @@ -10,12 +10,9 @@ using System; using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Imaging; using System.IO; using System.Linq; using OpenRA.Graphics; -using OpenRA.Primitives; using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits diff --git a/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs b/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs index 74e482f551..483fcb3d56 100644 --- a/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs +++ b/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Graphics; @@ -65,7 +63,7 @@ namespace OpenRA.Mods.Common.Traits var height = (int)map.MapHeight.Value[uv]; var tile = map.MapTiles.Value[uv]; var ti = tileSet.GetTileInfo(tile); - var ramp = ti != null ? (int)ti.RampType : 0; + var ramp = ti != null ? ti.RampType : 0; var corners = map.CellCorners[ramp]; var color = corners.Select(c => colors[height + c.Z / 512]).ToArray(); diff --git a/OpenRA.Mods.Common/Traits/World/WeatherOverlay.cs b/OpenRA.Mods.Common/Traits/World/WeatherOverlay.cs index ef22884a33..607c27118e 100644 --- a/OpenRA.Mods.Common/Traits/World/WeatherOverlay.cs +++ b/OpenRA.Mods.Common/Traits/World/WeatherOverlay.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index d23226482d..23ae4125e7 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Activities; using OpenRA.Graphics; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs index 6445c202fb..86bdf7d102 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractFilesCommand.cs @@ -11,7 +11,6 @@ using System; using System.IO; using System.Linq; -using OpenRA.FileSystem; namespace OpenRA.Mods.Common.UtilityCommands { diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs index 72752da821..be19d4fccd 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.UtilityCommands { Console.WriteLine("# {0}:", filename); var yaml = MiniYaml.FromFile(filename); - ExtractLanguageStringsCommand.FromChromeLayout(ref yaml, null, + FromChromeLayout(ref yaml, null, translatableFields.Select(t => t.Name).Distinct(), null); using (var file = new StreamWriter(filename)) file.WriteLine(yaml.WriteToString()); diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs index bb795edf8c..4602eb5fdd 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs @@ -9,9 +9,7 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; -using System.Text; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs index 5661f2e585..53e5f3802d 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs @@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.UtilityCommands if (t.IsSubclassOf(typeof(Array))) return "Multiple {0}".F(FriendlyTypeName(t.GetElementType())); - if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(OpenRA.Primitives.Cache<,>)) + if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Primitives.Cache<,>)) return "Cached<{0},{1}>".F(t.GetGenericArguments().Select(FriendlyTypeName).ToArray()); if (t == typeof(int) || t == typeof(uint)) diff --git a/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs b/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs index c72209eb13..fd2324dabb 100644 --- a/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs +++ b/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs @@ -266,7 +266,7 @@ namespace OpenRA.Mods.Common.UtilityCommands for (var i = 0; i < mapSize; i++) { var tileID = ms.ReadUInt16(); - types[i, j] = tileID == (ushort)0 ? (ushort)255 : tileID; // RAED weirdness + types[i, j] = tileID == 0 ? (ushort)255 : tileID; // RAED weirdness } } diff --git a/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs b/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs index a12860e199..e592fcff2b 100644 --- a/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs @@ -82,9 +82,9 @@ namespace OpenRA.Mods.Common.UtilityCommands var ca = Color.FromArgb((int)a); var cb = Color.FromArgb((int)b); - return Math.Abs((int)ca.R - (int)cb.R) + - Math.Abs((int)ca.G - (int)cb.G) + - Math.Abs((int)ca.B - (int)cb.B); + return Math.Abs(ca.R - cb.R) + + Math.Abs(ca.G - cb.G) + + Math.Abs(ca.B - cb.B); } } } diff --git a/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs b/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs index 424a783496..2fc304770f 100644 --- a/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/CreateResourceWarhead.cs @@ -10,8 +10,6 @@ using System.Collections.Generic; using System.Linq; -using OpenRA.Effects; -using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs b/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs index 848b73b49c..c924c62cbf 100644 --- a/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/DestroyResourceWarhead.cs @@ -9,9 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; -using OpenRA.Effects; -using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Warheads/GrantUpgradeWarhead.cs b/OpenRA.Mods.Common/Warheads/GrantUpgradeWarhead.cs index f45e1b4ea1..1b41e38baa 100644 --- a/OpenRA.Mods.Common/Warheads/GrantUpgradeWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/GrantUpgradeWarhead.cs @@ -10,9 +10,6 @@ using System.Collections.Generic; using System.Linq; -using OpenRA.Effects; -using OpenRA.GameRules; -using OpenRA.Mods.Common.Effects; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs index 3297c033b8..e64cd10ea0 100644 --- a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs @@ -11,8 +11,6 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenRA.Effects; -using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs index 982640b225..d49dc2dff2 100644 --- a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.GameRules; using OpenRA.Mods.Common.Traits; diff --git a/OpenRA.Mods.Common/Warheads/Warhead.cs b/OpenRA.Mods.Common/Warheads/Warhead.cs index 2dd0eed660..da844b647f 100644 --- a/OpenRA.Mods.Common/Warheads/Warhead.cs +++ b/OpenRA.Mods.Common/Warheads/Warhead.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.Common.Warheads diff --git a/OpenRA.Mods.Common/Widgets/ActorPreviewWidget.cs b/OpenRA.Mods.Common/Widgets/ActorPreviewWidget.cs index d27b3f1bc9..fa4e9b3d29 100644 --- a/OpenRA.Mods.Common/Widgets/ActorPreviewWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ActorPreviewWidget.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Graphics; diff --git a/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs b/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs index 863572dd8c..cd87f45768 100644 --- a/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs +++ b/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs @@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Widgets // Mask to prevent any clicks from being sent to other widgets fullscreenMask = new MaskWidget(); fullscreenMask.Bounds = new Rectangle(0, 0, Game.Renderer.Resolution.Width, Game.Renderer.Resolution.Height); - fullscreenMask.OnMouseDown += mi => { Game.Sound.PlayNotification(this.ModRules, null, "Sounds", "ClickSound", null); RemovePanel(); }; + fullscreenMask.OnMouseDown += mi => { Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickSound", null); RemovePanel(); }; if (onCancel != null) fullscreenMask.OnMouseDown += _ => onCancel(); diff --git a/OpenRA.Mods.Common/Widgets/EditorViewportControllerWidget.cs b/OpenRA.Mods.Common/Widgets/EditorViewportControllerWidget.cs index d1c324e10f..350e90b54f 100644 --- a/OpenRA.Mods.Common/Widgets/EditorViewportControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/EditorViewportControllerWidget.cs @@ -9,17 +9,7 @@ #endregion using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.Common.Traits; -using OpenRA.Orders; -using OpenRA.Primitives; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets diff --git a/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs index 5f173da7b1..a9c97f4cf2 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public ColorPickerLogic(Widget widget, World world, HSLColor initialColor, Action onChange, WorldRenderer worldRenderer) { string actorType; - if (!ChromeMetrics.TryGet("ColorPickerActorType", out actorType)) + if (!ChromeMetrics.TryGet("ColorPickerActorType", out actorType)) actorType = "mcv"; var preview = widget.GetOrNull("PREVIEW"); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs index b6d183b471..ec25c7dbab 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs @@ -9,14 +9,9 @@ #endregion using System; -using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Graphics; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.Common.Widgets; using OpenRA.Primitives; using OpenRA.Traits; using OpenRA.Widgets; @@ -38,7 +33,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic [ObjectCreator.UseCtor] public ActorSelectorLogic(Widget widget, World world, WorldRenderer worldRenderer) { - this.mapRules = world.Map.Rules; + mapRules = world.Map.Rules; this.world = world; this.worldRenderer = worldRenderer; @@ -126,7 +121,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic // Scale templates to fit within the panel var scale = 1f; if (scale * preview.IdealPreviewSize.X > itemTemplate.Bounds.Width) - scale = (float)(itemTemplate.Bounds.Width - panel.ItemSpacing) / (float)preview.IdealPreviewSize.X; + scale = (itemTemplate.Bounds.Width - panel.ItemSpacing) / (float)preview.IdealPreviewSize.X; preview.GetScale = () => scale; preview.Bounds.Width = (int)(scale * preview.IdealPreviewSize.X); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/LayerSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/LayerSelectorLogic.cs index 2e85f13950..4bdf52b81e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/LayerSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/LayerSelectorLogic.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; using OpenRA.Widgets; @@ -32,7 +30,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { this.modRules = modRules; this.worldRenderer = worldRenderer; - this.world = worldRenderer.World; + world = worldRenderer.World; editor = widget.Parent.Get("MAP_EDITOR"); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs index d19cd8ceed..6ed4230b16 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs @@ -9,10 +9,6 @@ #endregion -using System; -using System.Collections.Generic; -using System.Linq; -using OpenRA.GameRules; using OpenRA.Graphics; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs index 167d4335d3..8549b069d8 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs @@ -9,14 +9,7 @@ #endregion using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; using System.Linq; -using OpenRA; -using OpenRA.FileFormats; -using OpenRA.Mods.Common.Widgets; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 0064052c72..1b47f86aea 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using OpenRA.Mods.Common.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs index 968a175a6f..5e00ec8cf5 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs index 4357aa0b57..efcbf4ec6a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs @@ -8,12 +8,7 @@ */ #endregion -using System; -using System.Collections; -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Threading; using OpenRA.Chat; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ClassicProductionLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ClassicProductionLogic.cs index d14971adf3..46dd091375 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ClassicProductionLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ClassicProductionLogic.cs @@ -11,7 +11,6 @@ using System; using System.Linq; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.Common.Widgets; using OpenRA.Network; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ControlGroupLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ControlGroupLogic.cs index df3c03ee6d..19edb86ab6 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ControlGroupLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ControlGroupLogic.cs @@ -9,7 +9,6 @@ #endregion using OpenRA.Graphics; -using OpenRA.Mods.Common.Widgets; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs index 27181dba74..d1ba5420ba 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Linq; using OpenRA.Mods.Common.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs index db9b21412d..486cc61ff3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs @@ -12,7 +12,6 @@ using System; using System.Drawing; using System.Linq; using OpenRA.Mods.Common.Traits; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index f1a774b000..508dfd5fed 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -10,7 +10,6 @@ using System.Drawing; using System.Linq; -using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; using OpenRA.Network; using OpenRA.Primitives; @@ -63,7 +62,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic nameLabel.GetText = () => { var suffix = pp.WinState == WinState.Undefined ? "" : " (" + pp.WinState + ")"; - if (client != null && client.State == Network.Session.ClientState.Disconnected) + if (client != null && client.State == Session.ClientState.Disconnected) suffix = " (Gone)"; var sl = suffixLength.Update(suffix); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs index f125d7913a..ceb6fc0e1a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Mods.Common.Commands; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs index 25de9fc1ff..0c995e2441 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/MenuButtonsChromeLogic.cs @@ -10,9 +10,7 @@ using System; using System.Linq; -using OpenRA.Mods.Common.Orders; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.Common.Widgets; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/OrderButtonsChromeLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/OrderButtonsChromeLogic.cs index 2fff99c461..2adf9601d3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/OrderButtonsChromeLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/OrderButtonsChromeLogic.cs @@ -8,11 +8,7 @@ */ #endregion -using System; -using System.Linq; using OpenRA.Mods.Common.Orders; -using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.Common.Widgets; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs index b532cc4fab..92c1bd4b6f 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Drawing; using OpenRA.Traits; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/ClientTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/ClientTooltipLogic.cs index 824c018121..8bafcfa22f 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/ClientTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/ClientTooltipLogic.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Net; using OpenRA.Graphics; using OpenRA.Network; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs index a1600a8e09..5c0952ef05 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using OpenRA.Network; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index 2032b5178b..27b88dbabf 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic return item; }; - dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 167, options, setupItem); + dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 167, options, setupItem); } public static void ShowTeamDropDown(DropDownButtonWidget dropdown, Session.Client client, @@ -490,7 +490,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic playerName.GetText = () => { var suffix = player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")"; - if (client != null && client.State == Network.Session.ClientState.Disconnected) + if (client != null && client.State == Session.ClientState.Disconnected) suffix = " (Gone)"; var sl = suffixLength.Update(suffix); diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index fbf65cd305..7899d345a3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -244,7 +244,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic void LoadMapIntoEditor(Map map) { - ConnectionLogic.Connect(System.Net.IPAddress.Loopback.ToString(), + ConnectionLogic.Connect(IPAddress.Loopback.ToString(), Game.CreateLocalServer(map.Uid), "", () => { Game.LoadEditor(map.Uid); }, diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index 67beec2123..c951c1ae01 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -12,10 +12,8 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; using System.Threading; using OpenRA.Graphics; -using OpenRA.Network; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index da32f254ef..8b7a420f8a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -16,7 +16,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using OpenRA.FileFormats; -using OpenRA.Mods.Common.Widgets; using OpenRA.Primitives; using OpenRA.Widgets; diff --git a/OpenRA.Mods.Common/Widgets/MenuButtonWidget.cs b/OpenRA.Mods.Common/Widgets/MenuButtonWidget.cs index 9c1e98090b..bac03621d5 100644 --- a/OpenRA.Mods.Common/Widgets/MenuButtonWidget.cs +++ b/OpenRA.Mods.Common/Widgets/MenuButtonWidget.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Widgets; - namespace OpenRA.Mods.Common.Widgets { public class MenuButtonWidget : ButtonWidget diff --git a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs index c4a5e5339f..0346f07bae 100644 --- a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs @@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Widgets public ProductionPaletteWidget(OrderManager orderManager, World world, WorldRenderer worldRenderer) { this.orderManager = orderManager; - this.World = world; + World = world; this.worldRenderer = worldRenderer; tooltipContainer = Exts.Lazy(() => Ui.Root.Get(TooltipContainer)); diff --git a/OpenRA.Mods.Common/Widgets/ProductionTypeButtonWidget.cs b/OpenRA.Mods.Common/Widgets/ProductionTypeButtonWidget.cs index 69f749af53..0c3e32dd94 100644 --- a/OpenRA.Mods.Common/Widgets/ProductionTypeButtonWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ProductionTypeButtonWidget.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Widgets; - namespace OpenRA.Mods.Common.Widgets { public class ProductionTypeButtonWidget : ButtonWidget diff --git a/OpenRA.Mods.Common/Widgets/SpriteWidget.cs b/OpenRA.Mods.Common/Widgets/SpriteWidget.cs index a9858140cc..f09ccf5f2f 100644 --- a/OpenRA.Mods.Common/Widgets/SpriteWidget.cs +++ b/OpenRA.Mods.Common/Widgets/SpriteWidget.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Widgets { GetPalette = () => Palette; - this.WorldRenderer = worldRenderer; + WorldRenderer = worldRenderer; } protected SpriteWidget(SpriteWidget other) diff --git a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs index da2fcf62ed..99fddc6dc3 100644 --- a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; -using OpenRA.Orders; using OpenRA.Traits; using OpenRA.Widgets; diff --git a/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs b/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs index 931737a477..2a02bf9a60 100644 --- a/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs +++ b/OpenRA.Mods.D2k/SpriteLoaders/R8Loader.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.IO; diff --git a/OpenRA.Mods.D2k/Traits/AttractsWorms.cs b/OpenRA.Mods.D2k/Traits/AttractsWorms.cs index 66a505547b..727dd2356e 100644 --- a/OpenRA.Mods.D2k/Traits/AttractsWorms.cs +++ b/OpenRA.Mods.D2k/Traits/AttractsWorms.cs @@ -9,7 +9,6 @@ #endregion using OpenRA.Mods.Common.Traits; -using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits { diff --git a/OpenRA.Mods.D2k/Traits/Buildings/FreeActorWithDelivery.cs b/OpenRA.Mods.D2k/Traits/Buildings/FreeActorWithDelivery.cs index c1551ea723..675a3c8210 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/FreeActorWithDelivery.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/FreeActorWithDelivery.cs @@ -8,8 +8,6 @@ */ #endregion -using System.IO; -using OpenRA.Activities; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Mods.D2k.Activities; diff --git a/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs b/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs index 11c060ea79..7a5965abc4 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs b/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs index e7e8f35b44..ea4e939ea9 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs @@ -9,7 +9,6 @@ #endregion using System.Drawing; -using OpenRA.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.D2k/Traits/Carryall.cs b/OpenRA.Mods.D2k/Traits/Carryall.cs index 382576de31..9b45d9bca8 100644 --- a/OpenRA.Mods.D2k/Traits/Carryall.cs +++ b/OpenRA.Mods.D2k/Traits/Carryall.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; diff --git a/OpenRA.Mods.D2k/Traits/Render/WithDecorationCarryable.cs b/OpenRA.Mods.D2k/Traits/Render/WithDecorationCarryable.cs index 68f3369833..cc63afdeff 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithDecorationCarryable.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithDecorationCarryable.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.D2k/Traits/Sandworm.cs b/OpenRA.Mods.D2k/Traits/Sandworm.cs index 91ad133b6d..8dd6d69408 100644 --- a/OpenRA.Mods.D2k/Traits/Sandworm.cs +++ b/OpenRA.Mods.D2k/Traits/Sandworm.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.D2k/Traits/SpiceBloom.cs b/OpenRA.Mods.D2k/Traits/SpiceBloom.cs index 07280e08ca..698093abab 100644 --- a/OpenRA.Mods.D2k/Traits/SpiceBloom.cs +++ b/OpenRA.Mods.D2k/Traits/SpiceBloom.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Effects; diff --git a/OpenRA.Mods.RA/Activities/Infiltrate.cs b/OpenRA.Mods.RA/Activities/Infiltrate.cs index 9ac22715d0..2c58723c9b 100644 --- a/OpenRA.Mods.RA/Activities/Infiltrate.cs +++ b/OpenRA.Mods.RA/Activities/Infiltrate.cs @@ -10,7 +10,6 @@ using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities diff --git a/OpenRA.Mods.RA/Activities/LayMines.cs b/OpenRA.Mods.RA/Activities/LayMines.cs index 556772ce37..d3b343b07b 100644 --- a/OpenRA.Mods.RA/Activities/LayMines.cs +++ b/OpenRA.Mods.RA/Activities/LayMines.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Activities; diff --git a/OpenRA.Mods.RA/Activities/Teleport.cs b/OpenRA.Mods.RA/Activities/Teleport.cs index 7e200dd5f1..5a2ad396d9 100644 --- a/OpenRA.Mods.RA/Activities/Teleport.cs +++ b/OpenRA.Mods.RA/Activities/Teleport.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Traits; diff --git a/OpenRA.Mods.RA/Effects/GpsDot.cs b/OpenRA.Mods.RA/Effects/GpsDot.cs index 562d68380e..2b286343d6 100644 --- a/OpenRA.Mods.RA/Effects/GpsDot.cs +++ b/OpenRA.Mods.RA/Effects/GpsDot.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Linq; using OpenRA.Effects; using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; diff --git a/OpenRA.Mods.RA/Scripting/Properties/DisguiseProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/DisguiseProperties.cs index b017153b56..4a8a3d7b93 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/DisguiseProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/DisguiseProperties.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Scripting/Properties/InfiltrateProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/InfiltrateProperties.cs index 41bd1c98f0..4d6e741651 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/InfiltrateProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/InfiltrateProperties.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; diff --git a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs index 9634a8a93f..8d82ba6d57 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Traits/Mine.cs b/OpenRA.Mods.RA/Traits/Mine.cs index 849e5236eb..caed682f1b 100644 --- a/OpenRA.Mods.RA/Traits/Mine.cs +++ b/OpenRA.Mods.RA/Traits/Mine.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Mods.Common.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Traits/PaletteEffects/ChronoshiftPaletteEffect.cs b/OpenRA.Mods.RA/Traits/PaletteEffects/ChronoshiftPaletteEffect.cs index 276af2bec1..a031b832a7 100644 --- a/OpenRA.Mods.RA/Traits/PaletteEffects/ChronoshiftPaletteEffect.cs +++ b/OpenRA.Mods.RA/Traits/PaletteEffects/ChronoshiftPaletteEffect.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Traits/PaletteEffects/LightPaletteRotator.cs b/OpenRA.Mods.RA/Traits/PaletteEffects/LightPaletteRotator.cs index d955bf4d52..1a6d247bf6 100644 --- a/OpenRA.Mods.RA/Traits/PaletteEffects/LightPaletteRotator.cs +++ b/OpenRA.Mods.RA/Traits/PaletteEffects/LightPaletteRotator.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs index 554dd6df4c..0a234928bf 100644 --- a/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs @@ -111,7 +111,7 @@ namespace OpenRA.Mods.RA.Traits this.manager = manager; this.order = order; this.power = power; - this.range = ((ChronoshiftPowerInfo)power.Info).Range; + range = ((ChronoshiftPowerInfo)power.Info).Range; tile = world.Map.SequenceProvider.GetSequence("overlay", "target-select").GetSprite(0); } @@ -171,7 +171,7 @@ namespace OpenRA.Mods.RA.Traits this.order = order; this.power = power; this.sourceLocation = sourceLocation; - this.range = ((ChronoshiftPowerInfo)power.Info).Range; + range = ((ChronoshiftPowerInfo)power.Info).Range; var tileset = manager.Self.World.TileSet.Id.ToLowerInvariant(); validTile = world.Map.SequenceProvider.GetSequence("overlay", "target-valid-{0}".F(tileset)).GetSprite(0); diff --git a/OpenRA.Mods.TS/Activities/VoxelHarvesterDockSequence.cs b/OpenRA.Mods.TS/Activities/VoxelHarvesterDockSequence.cs index 6c718fc8f4..1bb536aa1b 100644 --- a/OpenRA.Mods.TS/Activities/VoxelHarvesterDockSequence.cs +++ b/OpenRA.Mods.TS/Activities/VoxelHarvesterDockSequence.cs @@ -10,7 +10,6 @@ using OpenRA.Activities; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.Common.Traits; using OpenRA.Mods.TS.Traits; namespace OpenRA.Mods.TS.Activities diff --git a/OpenRA.Mods.TS/SpriteLoaders/TmpTSLoader.cs b/OpenRA.Mods.TS/SpriteLoaders/TmpTSLoader.cs index 3a153d748c..8fe3ce0fbf 100644 --- a/OpenRA.Mods.TS/SpriteLoaders/TmpTSLoader.cs +++ b/OpenRA.Mods.TS/SpriteLoaders/TmpTSLoader.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using System.IO; using OpenRA.Graphics; diff --git a/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs b/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs index d735a3950f..40328738bb 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.TS.Traits diff --git a/OpenRA.Platforms.Default/DefaultPlatform.cs b/OpenRA.Platforms.Default/DefaultPlatform.cs index 2471de12e8..34b9f4ce10 100644 --- a/OpenRA.Platforms.Default/DefaultPlatform.cs +++ b/OpenRA.Platforms.Default/DefaultPlatform.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Drawing; -using System.Reflection; using OpenRA; [assembly: Platform(typeof(OpenRA.Platforms.Default.DeviceFactory))] diff --git a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs index 6d23802d8f..2ac15f3851 100644 --- a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs +++ b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs @@ -13,11 +13,6 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using OpenAL; -using OpenRA.FileFormats; -using OpenRA.FileSystem; -using OpenRA.GameRules; -using OpenRA.Primitives; -using OpenRA.Traits; namespace OpenRA.Platforms.Default { @@ -106,7 +101,7 @@ namespace OpenRA.Platforms.Default throw new InvalidOperationException("Can't create OpenAL device"); } - var ctx = ALC10.alcCreateContext(device, (int[])null); + var ctx = ALC10.alcCreateContext(device, null); if (ctx == IntPtr.Zero) throw new InvalidOperationException("Can't create OpenAL context"); ALC10.alcMakeContextCurrent(ctx); diff --git a/OpenRA.Platforms.Default/OpenGL.cs b/OpenRA.Platforms.Default/OpenGL.cs index d9973fc25d..0abb8ea780 100644 --- a/OpenRA.Platforms.Default/OpenGL.cs +++ b/OpenRA.Platforms.Default/OpenGL.cs @@ -362,11 +362,11 @@ namespace OpenRA.Platforms.Default DetectGLFeatures(); if (!Features.HasFlag(GLFeatures.GL2OrGreater) || !Features.HasFlag(GLFeatures.FramebufferExt)) { - WriteGraphicsLog("Unsupported OpenGL version: " + glGetString(OpenGL.GL_VERSION)); + WriteGraphicsLog("Unsupported OpenGL version: " + glGetString(GL_VERSION)); throw new InvalidProgramException("OpenGL Version Error: See graphics.log for details."); } else - Console.WriteLine("OpenGL version: " + glGetString(OpenGL.GL_VERSION)); + Console.WriteLine("OpenGL version: " + glGetString(GL_VERSION)); try { @@ -437,7 +437,7 @@ namespace OpenRA.Platforms.Default } catch (Exception e) { - OpenGL.WriteGraphicsLog("Failed to initialize OpenGL bindings.\nInner exception was: {0}".F(e)); + WriteGraphicsLog("Failed to initialize OpenGL bindings.\nInner exception was: {0}".F(e)); throw new InvalidProgramException("Failed to initialize OpenGL. See graphics.log for details."); } } @@ -451,7 +451,7 @@ namespace OpenRA.Platforms.Default { try { - var versionString = glGetString(OpenGL.GL_VERSION); + var versionString = glGetString(GL_VERSION); var version = versionString.Contains(" ") ? versionString.Split(' ')[0].Split('.') : versionString.Split('.'); var major = 0; @@ -474,8 +474,8 @@ namespace OpenRA.Platforms.Default public static void CheckGLError() { - var n = OpenGL.glGetError(); - if (n != OpenGL.GL_NO_ERROR) + var n = glGetError(); + if (n != GL_NO_ERROR) { var error = "GL Error: {0}\n{1}".F(n, new StackTrace()); WriteGraphicsLog(error); @@ -488,7 +488,7 @@ namespace OpenRA.Platforms.Default Log.Write("graphics", message); Log.Write("graphics", ""); Log.Write("graphics", "OpenGL Information:"); - var vendor = OpenGL.glGetString(OpenGL.GL_VENDOR); + var vendor = glGetString(GL_VENDOR); Log.Write("graphics", "Vendor: {0}", vendor); if (vendor.Contains("Microsoft")) { @@ -498,11 +498,11 @@ namespace OpenRA.Platforms.Default Log.Write("graphics", msg); } - Log.Write("graphics", "Renderer: {0}", OpenGL.glGetString(OpenGL.GL_RENDERER)); - Log.Write("graphics", "GL Version: {0}", OpenGL.glGetString(OpenGL.GL_VERSION)); - Log.Write("graphics", "Shader Version: {0}", OpenGL.glGetString(OpenGL.GL_SHADING_LANGUAGE_VERSION)); + Log.Write("graphics", "Renderer: {0}", glGetString(GL_RENDERER)); + Log.Write("graphics", "GL Version: {0}", glGetString(GL_VERSION)); + Log.Write("graphics", "Shader Version: {0}", glGetString(GL_SHADING_LANGUAGE_VERSION)); Log.Write("graphics", "Available extensions:"); - Log.Write("graphics", OpenGL.glGetString(OpenGL.GL_EXTENSIONS)); + Log.Write("graphics", glGetString(GL_EXTENSIONS)); } } } diff --git a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs b/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs index d67a02c50d..56b1fab222 100644 --- a/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs +++ b/OpenRA.Platforms.Default/Sdl2GraphicsDevice.cs @@ -12,8 +12,6 @@ using System; using System.Drawing; using System.IO; using System.Runtime.InteropServices; -using System.Threading; -using OpenRA; using OpenRA.Graphics; using SDL2; diff --git a/OpenRA.Platforms.Default/Sdl2Input.cs b/OpenRA.Platforms.Default/Sdl2Input.cs index e0f74255b8..3634389255 100644 --- a/OpenRA.Platforms.Default/Sdl2Input.cs +++ b/OpenRA.Platforms.Default/Sdl2Input.cs @@ -17,7 +17,7 @@ namespace OpenRA.Platforms.Default { class Sdl2Input { - MouseButton lastButtonBits = (MouseButton)0; + MouseButton lastButtonBits = MouseButton.None; public string GetClipboardText() { return SDL.SDL_GetClipboardText(); } public bool SetClipboardText(string text) { return SDL.SDL_SetClipboardText(text) == 0; } diff --git a/OpenRA.Platforms.Default/Shader.cs b/OpenRA.Platforms.Default/Shader.cs index 7b225a88ff..6c252f5930 100644 --- a/OpenRA.Platforms.Default/Shader.cs +++ b/OpenRA.Platforms.Default/Shader.cs @@ -44,7 +44,7 @@ namespace OpenRA.Platforms.Default int success; OpenGL.glGetShaderiv(shader, OpenGL.GL_COMPILE_STATUS, out success); OpenGL.CheckGLError(); - if (success == (int)OpenGL.GL_FALSE) + if (success == OpenGL.GL_FALSE) { int len; OpenGL.glGetShaderiv(shader, OpenGL.GL_INFO_LOG_LENGTH, out len); @@ -83,7 +83,7 @@ namespace OpenRA.Platforms.Default int success; OpenGL.glGetProgramiv(program, OpenGL.GL_LINK_STATUS, out success); OpenGL.CheckGLError(); - if (success == (int)OpenGL.GL_FALSE) + if (success == OpenGL.GL_FALSE) { int len; OpenGL.glGetProgramiv(program, OpenGL.GL_INFO_LOG_LENGTH, out len); diff --git a/OpenRA.Platforms.Default/Texture.cs b/OpenRA.Platforms.Default/Texture.cs index 365f1247bb..163806753b 100644 --- a/OpenRA.Platforms.Default/Texture.cs +++ b/OpenRA.Platforms.Default/Texture.cs @@ -63,14 +63,14 @@ namespace OpenRA.Platforms.Default OpenGL.CheckGLError(); var filter = scaleFilter == TextureScaleFilter.Linear ? OpenGL.GL_LINEAR : OpenGL.GL_NEAREST; - OpenGL.glTexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MAG_FILTER, (int)filter); + OpenGL.glTexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MAG_FILTER, filter); OpenGL.CheckGLError(); - OpenGL.glTexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MIN_FILTER, (int)filter); + OpenGL.glTexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MIN_FILTER, filter); OpenGL.CheckGLError(); - OpenGL.glTexParameterf(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_S, (float)OpenGL.GL_CLAMP_TO_EDGE); + OpenGL.glTexParameterf(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_S, OpenGL.GL_CLAMP_TO_EDGE); OpenGL.CheckGLError(); - OpenGL.glTexParameterf(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_T, (float)OpenGL.GL_CLAMP_TO_EDGE); + OpenGL.glTexParameterf(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_T, OpenGL.GL_CLAMP_TO_EDGE); OpenGL.CheckGLError(); OpenGL.glTexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_BASE_LEVEL, 0); @@ -137,7 +137,7 @@ namespace OpenRA.Platforms.Default { Size = new Size(bitmap.Width, bitmap.Height); var bits = bitmap.LockBits(bitmap.Bounds(), - ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); + ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); PrepareTexture(); OpenGL.glTexImage2D(OpenGL.GL_TEXTURE_2D, 0, OpenGL.GL_RGBA8, bits.Width, bits.Height, diff --git a/OpenRA.Platforms.Null/NullPlatform.cs b/OpenRA.Platforms.Null/NullPlatform.cs index 93a08bce3a..f66e7f8f1a 100644 --- a/OpenRA.Platforms.Null/NullPlatform.cs +++ b/OpenRA.Platforms.Null/NullPlatform.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using OpenRA; diff --git a/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs b/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs index 14b676f3b6..c216390fbe 100644 --- a/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs +++ b/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using NUnit.Framework; -using OpenRA.GameRules; using OpenRA.Traits; namespace OpenRA.Test diff --git a/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs b/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs index 9efd87709b..a78d35af24 100644 --- a/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs +++ b/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs @@ -9,12 +9,8 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using NUnit.Framework; -using OpenRA.GameRules; -using OpenRA.Traits; namespace OpenRA.Test {