diff --git a/GeoIP/Country.cs b/GeoIP/Country.cs index 3e16daaa5b..23d86cdc81 100644 --- a/GeoIP/Country.cs +++ b/GeoIP/Country.cs @@ -19,7 +19,6 @@ #endregion using System; -using System.IO; namespace GeoIP { diff --git a/GeoIP/DatabaseInfo.cs b/GeoIP/DatabaseInfo.cs index 54f9c77ba4..5a919c9fa2 100644 --- a/GeoIP/DatabaseInfo.cs +++ b/GeoIP/DatabaseInfo.cs @@ -19,7 +19,6 @@ #endregion using System; -using System.IO; namespace GeoIP { diff --git a/GeoIP/Location.cs b/GeoIP/Location.cs index 1eb6997ff8..e678c44291 100644 --- a/GeoIP/Location.cs +++ b/GeoIP/Location.cs @@ -19,7 +19,6 @@ #endregion using System; -using System.IO; namespace GeoIP { diff --git a/GeoIP/Region.cs b/GeoIP/Region.cs index 6954981dd7..e81b13a95c 100644 --- a/GeoIP/Region.cs +++ b/GeoIP/Region.cs @@ -19,7 +19,6 @@ #endregion using System; -using System.IO; public class Region { diff --git a/OpenRA.Editor/ActorTemplate.cs b/OpenRA.Editor/ActorTemplate.cs index aee71661d2..ed16fc1d08 100644 --- a/OpenRA.Editor/ActorTemplate.cs +++ b/OpenRA.Editor/ActorTemplate.cs @@ -9,7 +9,6 @@ #endregion using System.Drawing; -using OpenRA.GameRules; using OpenRA.Traits; namespace OpenRA.Editor diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index c5ac3fc376..64ce2de9ec 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -700,7 +700,7 @@ namespace OpenRA.Editor { int imageLength = 0; int type = surface1.Map.MapResources.Value[x, y].Type; - var template = surface1.ResourceTemplates.Where(a => a.Value.Info.ResourceType == type).FirstOrDefault().Value; + var template = surface1.ResourceTemplates.FirstOrDefault(a => a.Value.Info.ResourceType == type).Value; if (type == 1) imageLength = 12; else if (type == 2) diff --git a/OpenRA.Editor/MapSelect.cs b/OpenRA.Editor/MapSelect.cs index c6dfef0517..68d1514497 100644 --- a/OpenRA.Editor/MapSelect.cs +++ b/OpenRA.Editor/MapSelect.cs @@ -79,7 +79,7 @@ namespace OpenRA.Editor } catch (Exception ed) { - Console.WriteLine("No map preview image found: {0}", ed.ToString()); + Console.WriteLine("No map preview image found: {0}", ed); } } } diff --git a/OpenRA.Editor/RenderUtils.cs b/OpenRA.Editor/RenderUtils.cs index 01d8fd2f0f..f7b6871521 100644 --- a/OpenRA.Editor/RenderUtils.cs +++ b/OpenRA.Editor/RenderUtils.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using System.Drawing.Imaging; using OpenRA.FileFormats; diff --git a/OpenRA.Editor/Surface.cs b/OpenRA.Editor/Surface.cs index 710e49d604..793d84145a 100644 --- a/OpenRA.Editor/Surface.cs +++ b/OpenRA.Editor/Surface.cs @@ -107,7 +107,6 @@ namespace OpenRA.Editor public Dictionary Chunks = new Dictionary(); public Surface() - : base() { BackColor = Color.Black; diff --git a/OpenRA.FileFormats/Exts.cs b/OpenRA.FileFormats/Exts.cs index ae878cb495..f9cdf7bd6a 100755 --- a/OpenRA.FileFormats/Exts.cs +++ b/OpenRA.FileFormats/Exts.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.IO; using System.Linq; using System.Reflection; diff --git a/OpenRA.FileFormats/FieldLoader.cs b/OpenRA.FileFormats/FieldLoader.cs index 0dc062df43..d0039bde8c 100755 --- a/OpenRA.FileFormats/FieldLoader.cs +++ b/OpenRA.FileFormats/FieldLoader.cs @@ -314,7 +314,7 @@ namespace OpenRA.FileFormats return null; } - static object ParseYesNo(string p, System.Type fieldType, string field) + static object ParseYesNo(string p, Type fieldType, string field) { p = p.ToLowerInvariant(); if (p == "yes") return true; diff --git a/OpenRA.FileFormats/FieldSaver.cs b/OpenRA.FileFormats/FieldSaver.cs index 65208da2b5..2cbe8415bf 100644 --- a/OpenRA.FileFormats/FieldSaver.cs +++ b/OpenRA.FileFormats/FieldSaver.cs @@ -48,7 +48,7 @@ namespace OpenRA.FileFormats public static MiniYamlNode SaveField(object o, string field) { - return new MiniYamlNode(field, FieldSaver.FormatValue(o, o.GetType().GetField(field))); + return new MiniYamlNode(field, FormatValue(o, o.GetType().GetField(field))); } public static string FormatValue(object v, Type t) diff --git a/OpenRA.FileFormats/FileFormats/CRC32.cs b/OpenRA.FileFormats/FileFormats/CRC32.cs index 61de944e55..59cb9d5cc7 100644 --- a/OpenRA.FileFormats/FileFormats/CRC32.cs +++ b/OpenRA.FileFormats/FileFormats/CRC32.cs @@ -92,7 +92,7 @@ namespace OpenRA.FileFormats /// A fast (native) CRC32 implementation that can be used on a regular byte arrays. /// /// The data from which to calculate the checksum. - /// The polynomal. + /// The polynomial. /// /// The calculated checksum. /// @@ -115,7 +115,7 @@ namespace OpenRA.FileFormats /// /// [in,out] If non-null, the. /// The length of the data data. - /// The polynomal to xor with. + /// The polynomal to xor with. /// The calculated checksum. public static unsafe uint Calculate(byte* data, uint len, uint polynomial) { diff --git a/OpenRA.FileFormats/FileFormats/IniFile.cs b/OpenRA.FileFormats/FileFormats/IniFile.cs index 2ab2238b3d..3ead81baa5 100644 --- a/OpenRA.FileFormats/FileFormats/IniFile.cs +++ b/OpenRA.FileFormats/FileFormats/IniFile.cs @@ -56,7 +56,7 @@ namespace OpenRA.FileFormats IniSection ProcessSection(string line) { Match m = sectionPattern.Match(line); - if (m == null || !m.Success) + if (!m.Success) return null; string sectionName = m.Groups[1].Value.ToLowerInvariant(); diff --git a/OpenRA.FileFormats/FileFormats/WavLoader.cs b/OpenRA.FileFormats/FileFormats/WavLoader.cs index 73c6233bde..d85adc7cd7 100644 --- a/OpenRA.FileFormats/FileFormats/WavLoader.cs +++ b/OpenRA.FileFormats/FileFormats/WavLoader.cs @@ -10,7 +10,6 @@ using System; using System.IO; -using System.Text; namespace OpenRA.FileFormats { diff --git a/OpenRA.FileFormats/FileSystem/D2kSoundResources.cs b/OpenRA.FileFormats/FileSystem/D2kSoundResources.cs index c84c12e41c..f1af247d0e 100644 --- a/OpenRA.FileFormats/FileSystem/D2kSoundResources.cs +++ b/OpenRA.FileFormats/FileSystem/D2kSoundResources.cs @@ -9,11 +9,8 @@ #endregion using System; -using System.Collections; using System.Collections.Generic; -using System.Globalization; using System.IO; -using System.Linq; namespace OpenRA.FileFormats { diff --git a/OpenRA.FileFormats/FileSystem/FileSystem.cs b/OpenRA.FileFormats/FileSystem/FileSystem.cs index 6046908e67..84f3f4c654 100644 --- a/OpenRA.FileFormats/FileSystem/FileSystem.cs +++ b/OpenRA.FileFormats/FileSystem/FileSystem.cs @@ -97,7 +97,7 @@ namespace OpenRA.FileFormats name = Platform.SupportDir + name.Substring(1); FolderPaths.Add(name); - Action a = () => FileSystem.MountInner(OpenPackage(name, annotation, order++)); + Action a = () => MountInner(OpenPackage(name, annotation, order++)); if (optional) try { a(); } @@ -197,8 +197,8 @@ namespace OpenRA.FileFormats if (assemblyCache.TryGetValue(filename, out a)) return a; - if (FileSystem.Exists(filename)) - using (var s = FileSystem.Open(filename)) + if (Exists(filename)) + using (var s = Open(filename)) { var buf = new byte[s.Length]; s.Read(buf, 0, buf.Length); diff --git a/OpenRA.FileFormats/FileSystem/Folder.cs b/OpenRA.FileFormats/FileSystem/Folder.cs index c109392501..3d30fac467 100644 --- a/OpenRA.FileFormats/FileSystem/Folder.cs +++ b/OpenRA.FileFormats/FileSystem/Folder.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.IO; -using System; namespace OpenRA.FileFormats { diff --git a/OpenRA.FileFormats/FileSystem/InstallShieldPackage.cs b/OpenRA.FileFormats/FileSystem/InstallShieldPackage.cs index da156fbbfa..24caca2e4e 100644 --- a/OpenRA.FileFormats/FileSystem/InstallShieldPackage.cs +++ b/OpenRA.FileFormats/FileSystem/InstallShieldPackage.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; namespace OpenRA.FileFormats { diff --git a/OpenRA.FileFormats/Graphics/HvaReader.cs b/OpenRA.FileFormats/Graphics/HvaReader.cs index 177d6e4b6d..1f52fb5f41 100644 --- a/OpenRA.FileFormats/Graphics/HvaReader.cs +++ b/OpenRA.FileFormats/Graphics/HvaReader.cs @@ -9,9 +9,7 @@ #endregion -using System; using System.IO; -using System.Linq; namespace OpenRA.FileFormats { diff --git a/OpenRA.FileFormats/Graphics/IGraphicsDevice.cs b/OpenRA.FileFormats/Graphics/IGraphicsDevice.cs index efd2bb6cfb..16f0b67d39 100755 --- a/OpenRA.FileFormats/Graphics/IGraphicsDevice.cs +++ b/OpenRA.FileFormats/Graphics/IGraphicsDevice.cs @@ -10,7 +10,6 @@ using System; using System.Drawing; -using System.IO; namespace OpenRA.FileFormats.Graphics { diff --git a/OpenRA.FileFormats/Graphics/IInputHandler.cs b/OpenRA.FileFormats/Graphics/IInputHandler.cs index 37ef56259b..1515283e52 100755 --- a/OpenRA.FileFormats/Graphics/IInputHandler.cs +++ b/OpenRA.FileFormats/Graphics/IInputHandler.cs @@ -9,8 +9,6 @@ #endregion using System; -using System.Collections.Generic; -using System.Linq; namespace OpenRA { diff --git a/OpenRA.FileFormats/Graphics/R8Reader.cs b/OpenRA.FileFormats/Graphics/R8Reader.cs index d737af6cee..132c48a436 100644 --- a/OpenRA.FileFormats/Graphics/R8Reader.cs +++ b/OpenRA.FileFormats/Graphics/R8Reader.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections; using System.Collections.Generic; using System.Drawing; diff --git a/OpenRA.FileFormats/Graphics/TileSetRenderer.cs b/OpenRA.FileFormats/Graphics/TileSetRenderer.cs index 98b25d7df1..98c7459438 100644 --- a/OpenRA.FileFormats/Graphics/TileSetRenderer.cs +++ b/OpenRA.FileFormats/Graphics/TileSetRenderer.cs @@ -11,9 +11,7 @@ using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; -using System.IO; using System.Linq; -using System.Reflection; namespace OpenRA.FileFormats { diff --git a/OpenRA.FileFormats/Graphics/VxlReader.cs b/OpenRA.FileFormats/Graphics/VxlReader.cs index 69548661e5..2873ecd92b 100644 --- a/OpenRA.FileFormats/Graphics/VxlReader.cs +++ b/OpenRA.FileFormats/Graphics/VxlReader.cs @@ -9,7 +9,6 @@ #endregion -using System; using System.Collections.Generic; using System.IO; diff --git a/OpenRA.FileFormats/Hotkey.cs b/OpenRA.FileFormats/Hotkey.cs index d95dff8243..67839e3f3a 100755 --- a/OpenRA.FileFormats/Hotkey.cs +++ b/OpenRA.FileFormats/Hotkey.cs @@ -8,11 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Linq; -using OpenRA.FileFormats; - namespace OpenRA { public struct Hotkey diff --git a/OpenRA.FileFormats/Keycode.cs b/OpenRA.FileFormats/Keycode.cs index 3857737397..ae5e201606 100755 --- a/OpenRA.FileFormats/Keycode.cs +++ b/OpenRA.FileFormats/Keycode.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Collections.Generic; -using System.Linq; namespace OpenRA { diff --git a/OpenRA.FileFormats/Map/PlayerReference.cs b/OpenRA.FileFormats/Map/PlayerReference.cs index 91109c1407..e9a56d4e09 100644 --- a/OpenRA.FileFormats/Map/PlayerReference.cs +++ b/OpenRA.FileFormats/Map/PlayerReference.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using System.Drawing; - namespace OpenRA.FileFormats { public class PlayerReference diff --git a/OpenRA.FileFormats/Map/TileSet.cs b/OpenRA.FileFormats/Map/TileSet.cs index 2750150dd2..2e9dccb954 100644 --- a/OpenRA.FileFormats/Map/TileSet.cs +++ b/OpenRA.FileFormats/Map/TileSet.cs @@ -10,8 +10,6 @@ using System.Collections.Generic; using System.Drawing; -using System.Drawing.Imaging; -using System.IO; using System.Linq; using System.Reflection; diff --git a/OpenRA.FileFormats/Palette.cs b/OpenRA.FileFormats/Palette.cs index ceccccd81b..784b6efc7b 100644 --- a/OpenRA.FileFormats/Palette.cs +++ b/OpenRA.FileFormats/Palette.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; diff --git a/OpenRA.FileFormats/Primitives/ObservableCollection.cs b/OpenRA.FileFormats/Primitives/ObservableCollection.cs index 610cb28762..d03945fb28 100644 --- a/OpenRA.FileFormats/Primitives/ObservableCollection.cs +++ b/OpenRA.FileFormats/Primitives/ObservableCollection.cs @@ -23,7 +23,7 @@ namespace OpenRA.FileFormats.Primitives public event Action OnSet = (o, n) => { }; public event Action OnRefresh = () => { }; - public ObservableCollection() : base() { } + public ObservableCollection() { } public ObservableCollection(IList list) : base(list) { } protected override void SetItem(int index, T item) @@ -53,7 +53,7 @@ namespace OpenRA.FileFormats.Primitives public IEnumerable ObservedItems { - get { return base.Items; } + get { return Items; } } } } diff --git a/OpenRA.FileFormats/Primitives/Pair.cs b/OpenRA.FileFormats/Primitives/Pair.cs index 26a86639dc..25a3f69317 100644 --- a/OpenRA.FileFormats/Primitives/Pair.cs +++ b/OpenRA.FileFormats/Primitives/Pair.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System; using System.Drawing; namespace OpenRA.FileFormats diff --git a/OpenRA.FileFormats/Support/Log.cs b/OpenRA.FileFormats/Support/Log.cs index 1d5bcd4cf2..19c62e07eb 100755 --- a/OpenRA.FileFormats/Support/Log.cs +++ b/OpenRA.FileFormats/Support/Log.cs @@ -11,9 +11,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Net; namespace OpenRA { diff --git a/OpenRA.FileFormats/WAngle.cs b/OpenRA.FileFormats/WAngle.cs index 3704783c9d..498f0743e1 100644 --- a/OpenRA.FileFormats/WAngle.cs +++ b/OpenRA.FileFormats/WAngle.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Drawing; namespace OpenRA { diff --git a/OpenRA.FileFormats/WPos.cs b/OpenRA.FileFormats/WPos.cs index 7c48ccbb57..dab241089b 100644 --- a/OpenRA.FileFormats/WPos.cs +++ b/OpenRA.FileFormats/WPos.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; -using System.Drawing; namespace OpenRA { diff --git a/OpenRA.FileFormats/WRange.cs b/OpenRA.FileFormats/WRange.cs index 07ce9ff85b..42a390e27f 100644 --- a/OpenRA.FileFormats/WRange.cs +++ b/OpenRA.FileFormats/WRange.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Drawing; using System.Linq; namespace OpenRA diff --git a/OpenRA.FileFormats/WRot.cs b/OpenRA.FileFormats/WRot.cs index 4a4b7bd18b..a2c87aefeb 100644 --- a/OpenRA.FileFormats/WRot.cs +++ b/OpenRA.FileFormats/WRot.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using System.Drawing; - namespace OpenRA { /// diff --git a/OpenRA.FileFormats/WVec.cs b/OpenRA.FileFormats/WVec.cs index f68cd36450..b76a17fd3e 100644 --- a/OpenRA.FileFormats/WVec.cs +++ b/OpenRA.FileFormats/WVec.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Drawing; namespace OpenRA { diff --git a/OpenRA.Game/Download.cs b/OpenRA.Game/Download.cs index e69396235d..5955d3b588 100644 --- a/OpenRA.Game/Download.cs +++ b/OpenRA.Game/Download.cs @@ -21,7 +21,7 @@ namespace OpenRA public static string FormatErrorMessage(Exception e) { - var ex = e as System.Net.WebException; + var ex = e as WebException; if (ex == null) return e.Message; @@ -46,15 +46,15 @@ namespace OpenRA wc.DownloadProgressChanged += (_, a) => onProgress(a); wc.DownloadFileCompleted += (_, a) => onComplete(a, cancelled); - Game.OnQuit += () => Cancel(); - wc.DownloadFileCompleted += (_, a) => { Game.OnQuit -= () => Cancel(); }; + Game.OnQuit += Cancel; + wc.DownloadFileCompleted += (_, a) => { Game.OnQuit -= Cancel; }; wc.DownloadFileAsync(new Uri(url), path); } public void Cancel() { - Game.OnQuit -= () => Cancel(); + Game.OnQuit -= Cancel; wc.CancelAsync(); cancelled = true; } diff --git a/OpenRA.Game/Effects/DelayedAction.cs b/OpenRA.Game/Effects/DelayedAction.cs index 1cb1440874..c99870da9b 100755 --- a/OpenRA.Game/Effects/DelayedAction.cs +++ b/OpenRA.Game/Effects/DelayedAction.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Effects { diff --git a/OpenRA.Game/Effects/IEffect.cs b/OpenRA.Game/Effects/IEffect.cs index 33d4ada440..43f5abdb6c 100755 --- a/OpenRA.Game/Effects/IEffect.cs +++ b/OpenRA.Game/Effects/IEffect.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Effects { diff --git a/OpenRA.Game/Effects/MoveFlash.cs b/OpenRA.Game/Effects/MoveFlash.cs index 762ce5106c..3017a150fe 100644 --- a/OpenRA.Game/Effects/MoveFlash.cs +++ b/OpenRA.Game/Effects/MoveFlash.cs @@ -9,10 +9,7 @@ #endregion using System.Collections.Generic; -using OpenRA.Effects; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Effects { diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 054dda2dd0..025d1414df 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -103,7 +103,7 @@ namespace OpenRA // Load a widget with world, orderManager, worldRenderer args, without adding it to the widget tree public static Widget LoadWidget(World world, string id, Widget parent, WidgetArgs args) { - return Game.modData.WidgetLoader.LoadWidget(new WidgetArgs(args) + return modData.WidgetLoader.LoadWidget(new WidgetArgs(args) { { "world", world }, { "orderManager", orderManager }, @@ -135,23 +135,23 @@ namespace OpenRA // worldRenderer is null during the initial install/download screen if (worldRenderer != null) { - Game.Renderer.BeginFrame(worldRenderer.Viewport.TopLeft.ToFloat2(), worldRenderer.Viewport.Zoom); + Renderer.BeginFrame(worldRenderer.Viewport.TopLeft.ToFloat2(), worldRenderer.Viewport.Zoom); Sound.SetListenerPosition(worldRenderer.Position(worldRenderer.Viewport.CenterLocation)); worldRenderer.Draw(); } else - Game.Renderer.BeginFrame(float2.Zero, 1f); + Renderer.BeginFrame(float2.Zero, 1f); using (new PerfSample("render_widgets")) { Ui.Draw(); var cursorName = Ui.Root.GetCursorOuter(Viewport.LastMousePos) ?? "default"; - CursorProvider.DrawCursor(Game.Renderer, cursorName, Viewport.LastMousePos, (int)cursorFrame); + CursorProvider.DrawCursor(Renderer, cursorName, Viewport.LastMousePos, (int)cursorFrame); } using (new PerfSample("render_flip")) { - Game.Renderer.EndFrame(new DefaultInputHandler(orderManager.world)); + Renderer.EndFrame(new DefaultInputHandler(orderManager.world)); } } @@ -374,13 +374,13 @@ namespace OpenRA JoinLocal(); - if (Game.Settings.Server.Dedicated) + if (Settings.Server.Dedicated) { while (true) { - Game.Settings.Server.Map = WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map); - Game.Settings.Save(); - Game.CreateServer(new ServerSettings(Game.Settings.Server)); + Settings.Server.Map = WidgetUtils.ChooseInitialMap(Settings.Server.Map); + Settings.Save(); + CreateServer(new ServerSettings(Settings.Server)); while (true) { System.Threading.Thread.Sleep(100); @@ -393,15 +393,14 @@ namespace OpenRA break; } } - if (Game.Settings.Server.DedicatedLoop) + if (Settings.Server.DedicatedLoop) { Console.WriteLine("Starting a new server instance..."); continue; } - else - break; + break; } - System.Environment.Exit(0); + Environment.Exit(0); } else { @@ -420,7 +419,7 @@ namespace OpenRA var shellmaps = modData.AvailableMaps .Where(m => m.Value.UseAsShellmap); - if (shellmaps.Count() == 0) + if (!shellmaps.Any()) throw new InvalidDataException("No valid shellmaps available"); return shellmaps.Random(CosmeticRandom).Key; @@ -482,7 +481,7 @@ namespace OpenRA public static void CreateServer(ServerSettings settings) { server = new Server.Server(new IPEndPoint(IPAddress.Any, settings.ListenPort), - Game.Settings.Game.Mods, settings, modData); + Settings.Game.Mods, settings, modData); } public static int CreateLocalServer(string map) @@ -496,7 +495,7 @@ namespace OpenRA }; server = new Server.Server(new IPEndPoint(IPAddress.Loopback, 0), - Game.Settings.Game.Mods, settings, modData); + Settings.Game.Mods, settings, modData); return server.Port; } @@ -510,7 +509,7 @@ namespace OpenRA { try { - var mod = Game.CurrentMods.FirstOrDefault().Value.Id; + var mod = CurrentMods.First().Value.Id; var dirPath = "{1}maps{0}{2}".F(Path.DirectorySeparatorChar, Platform.SupportDir, mod); if(!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath); diff --git a/OpenRA.Game/GameRules/Settings.cs b/OpenRA.Game/GameRules/Settings.cs index a03fb2de36..2bfcfb42ab 100644 --- a/OpenRA.Game/GameRules/Settings.cs +++ b/OpenRA.Game/GameRules/Settings.cs @@ -10,12 +10,9 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.IO; -using System.Windows.Forms; using OpenRA.FileFormats; using OpenRA.FileFormats.Graphics; -using OpenRA.Server; namespace OpenRA.GameRules { diff --git a/OpenRA.Game/GameRules/SoundInfo.cs b/OpenRA.Game/GameRules/SoundInfo.cs index 4561bb6c68..dcfde842ab 100644 --- a/OpenRA.Game/GameRules/SoundInfo.cs +++ b/OpenRA.Game/GameRules/SoundInfo.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; diff --git a/OpenRA.Game/Graphics/AnimationWithOffset.cs b/OpenRA.Game/Graphics/AnimationWithOffset.cs index 38ee527a4a..dd3075c5b3 100644 --- a/OpenRA.Game/Graphics/AnimationWithOffset.cs +++ b/OpenRA.Game/Graphics/AnimationWithOffset.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using OpenRA.Traits; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/BeamRenderable.cs b/OpenRA.Game/Graphics/BeamRenderable.cs index 82e62858bf..965e5505b1 100644 --- a/OpenRA.Game/Graphics/BeamRenderable.cs +++ b/OpenRA.Game/Graphics/BeamRenderable.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/ContrailRenderable.cs b/OpenRA.Game/Graphics/ContrailRenderable.cs index 0e5df553ed..bfd3f2c8b7 100644 --- a/OpenRA.Game/Graphics/ContrailRenderable.cs +++ b/OpenRA.Game/Graphics/ContrailRenderable.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; using System.Drawing; using System.Linq; diff --git a/OpenRA.Game/Graphics/CursorProvider.cs b/OpenRA.Game/Graphics/CursorProvider.cs index 6d76ff5315..def36ece8b 100644 --- a/OpenRA.Game/Graphics/CursorProvider.cs +++ b/OpenRA.Game/Graphics/CursorProvider.cs @@ -10,11 +10,8 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Xml; using OpenRA.FileFormats; -using OpenRA.Traits; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/CursorSequence.cs b/OpenRA.Game/Graphics/CursorSequence.cs index 923510ff53..70997f1bee 100644 --- a/OpenRA.Game/Graphics/CursorSequence.cs +++ b/OpenRA.Game/Graphics/CursorSequence.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Xml; using OpenRA.FileFormats; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/MappedImage.cs b/OpenRA.Game/Graphics/MappedImage.cs index d69e2598ba..1ddf99f24d 100644 --- a/OpenRA.Game/Graphics/MappedImage.cs +++ b/OpenRA.Game/Graphics/MappedImage.cs @@ -9,8 +9,6 @@ #endregion using System.Drawing; -using System.IO; -using System.Xml; using OpenRA.FileFormats; using System.Collections.Generic; diff --git a/OpenRA.Game/Graphics/Minimap.cs b/OpenRA.Game/Graphics/Minimap.cs index 2de2a4e638..9c8e89c625 100644 --- a/OpenRA.Game/Graphics/Minimap.cs +++ b/OpenRA.Game/Graphics/Minimap.cs @@ -13,7 +13,6 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Traits; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/Sequence.cs b/OpenRA.Game/Graphics/Sequence.cs index 0bcd018cc7..0b8d3a9302 100644 --- a/OpenRA.Game/Graphics/Sequence.cs +++ b/OpenRA.Game/Graphics/Sequence.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; using OpenRA.FileFormats.Graphics; diff --git a/OpenRA.Game/Graphics/SheetBuilder.cs b/OpenRA.Game/Graphics/SheetBuilder.cs index 75183a8e9a..a2ba52d535 100644 --- a/OpenRA.Game/Graphics/SheetBuilder.cs +++ b/OpenRA.Game/Graphics/SheetBuilder.cs @@ -38,7 +38,7 @@ namespace OpenRA.Graphics public static Sheet AllocateSheet() { - return new Sheet(new Size(Renderer.SheetSize, Renderer.SheetSize));; + return new Sheet(new Size(Renderer.SheetSize, Renderer.SheetSize)); } internal SheetBuilder(SheetType t) diff --git a/OpenRA.Game/Graphics/SpriteFont.cs b/OpenRA.Game/Graphics/SpriteFont.cs index 9c62ad8ef0..32ddb7ff3b 100644 --- a/OpenRA.Game/Graphics/SpriteFont.cs +++ b/OpenRA.Game/Graphics/SpriteFont.cs @@ -11,7 +11,6 @@ using System; using System.Drawing; using System.Linq; -using System.Runtime.InteropServices; using OpenRA.FileFormats; using SharpFont; diff --git a/OpenRA.Game/Graphics/SpriteLoader.cs b/OpenRA.Game/Graphics/SpriteLoader.cs index 135eb4934b..ff14eca590 100644 --- a/OpenRA.Game/Graphics/SpriteLoader.cs +++ b/OpenRA.Game/Graphics/SpriteLoader.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Drawing; using System.IO; using System.Linq; using OpenRA.FileFormats; diff --git a/OpenRA.Game/Graphics/TerrainRenderer.cs b/OpenRA.Game/Graphics/TerrainRenderer.cs index 423f14aa5d..ebacdf202d 100644 --- a/OpenRA.Game/Graphics/TerrainRenderer.cs +++ b/OpenRA.Game/Graphics/TerrainRenderer.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using System.Drawing; -using OpenRA.FileFormats; using OpenRA.FileFormats.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Game/Graphics/TextRenderable.cs b/OpenRA.Game/Graphics/TextRenderable.cs index 299893cef5..52a0a765ed 100644 --- a/OpenRA.Game/Graphics/TextRenderable.cs +++ b/OpenRA.Game/Graphics/TextRenderable.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using System.Drawing; namespace OpenRA.Graphics diff --git a/OpenRA.Game/Graphics/Theater.cs b/OpenRA.Game/Graphics/Theater.cs index 034cefdb38..48bfc1451f 100644 --- a/OpenRA.Game/Graphics/Theater.cs +++ b/OpenRA.Game/Graphics/Theater.cs @@ -11,11 +11,8 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.IO; using System.Linq; using OpenRA.FileFormats; -using OpenRA.FileFormats.Graphics; -using OpenRA.Traits; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/Util.cs b/OpenRA.Game/Graphics/Util.cs index c859121b9d..a997d1b6fa 100644 --- a/OpenRA.Game/Graphics/Util.cs +++ b/OpenRA.Game/Graphics/Util.cs @@ -258,7 +258,7 @@ namespace OpenRA.Graphics for (var i = 0; i < 8; i++) { var vec = new float[] {bounds[ix[i]], bounds[iy[i]], bounds[iz[i]], 1}; - var tvec = Util.MatrixVectorMultiply(mtx, vec); + var tvec = MatrixVectorMultiply(mtx, vec); ret[0] = Math.Min(ret[0], tvec[0]/tvec[3]); ret[1] = Math.Min(ret[1], tvec[1]/tvec[3]); diff --git a/OpenRA.Game/Graphics/Viewport.cs b/OpenRA.Game/Graphics/Viewport.cs index d2625dfbd6..cc6ac5c0c2 100755 --- a/OpenRA.Game/Graphics/Viewport.cs +++ b/OpenRA.Game/Graphics/Viewport.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.Support; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/Voxel.cs b/OpenRA.Game/Graphics/Voxel.cs index 98d6f72544..1a0aa8416b 100644 --- a/OpenRA.Game/Graphics/Voxel.cs +++ b/OpenRA.Game/Graphics/Voxel.cs @@ -9,11 +9,8 @@ #endregion using System; -using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.FileFormats; -using OpenRA.FileFormats.Graphics; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/VoxelAnimation.cs b/OpenRA.Game/Graphics/VoxelAnimation.cs index 7cbb003878..d45649d2ad 100644 --- a/OpenRA.Game/Graphics/VoxelAnimation.cs +++ b/OpenRA.Game/Graphics/VoxelAnimation.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using OpenRA.Traits; namespace OpenRA.Graphics { diff --git a/OpenRA.Game/Graphics/VoxelRenderable.cs b/OpenRA.Game/Graphics/VoxelRenderable.cs index f8b6631508..3d6fe80e4f 100644 --- a/OpenRA.Game/Graphics/VoxelRenderable.cs +++ b/OpenRA.Game/Graphics/VoxelRenderable.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.Linq; diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index b736ef2840..422914251e 100755 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -14,7 +14,6 @@ using System.IO; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA @@ -163,7 +162,7 @@ namespace OpenRA catch (Exception e) { Console.WriteLine("Failed to load map: {0}", path); - Console.WriteLine("Details: {0}", e.ToString()); + Console.WriteLine("Details: {0}", e); } } diff --git a/OpenRA.Game/Network/FrameData.cs b/OpenRA.Game/Network/FrameData.cs index abb891ae64..cae41bc1d6 100755 --- a/OpenRA.Game/Network/FrameData.cs +++ b/OpenRA.Game/Network/FrameData.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; diff --git a/OpenRA.Game/Network/GameServer.cs b/OpenRA.Game/Network/GameServer.cs index e355b325e3..fed810d5fb 100644 --- a/OpenRA.Game/Network/GameServer.cs +++ b/OpenRA.Game/Network/GameServer.cs @@ -10,8 +10,6 @@ using System.Collections.Generic; using System.Linq; -using System.Net.NetworkInformation; -using System.Threading; namespace OpenRA.Network { diff --git a/OpenRA.Game/Network/Handshake.cs b/OpenRA.Game/Network/Handshake.cs index c18d58e559..2d96a9d2d7 100644 --- a/OpenRA.Game/Network/Handshake.cs +++ b/OpenRA.Game/Network/Handshake.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.FileFormats; diff --git a/OpenRA.Game/Network/OrderManager.cs b/OpenRA.Game/Network/OrderManager.cs index 1e8c0257cb..e60229c50e 100755 --- a/OpenRA.Game/Network/OrderManager.cs +++ b/OpenRA.Game/Network/OrderManager.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using OpenRA.FileFormats; diff --git a/OpenRA.Game/Network/Replay.cs b/OpenRA.Game/Network/Replay.cs index bf165c5ecf..3e6970d756 100644 --- a/OpenRA.Game/Network/Replay.cs +++ b/OpenRA.Game/Network/Replay.cs @@ -9,7 +9,6 @@ #endregion using System; -using OpenRA.Network; namespace OpenRA.Network { diff --git a/OpenRA.Game/Network/ReplayConnection.cs b/OpenRA.Game/Network/ReplayConnection.cs index c37781411d..a705a2196b 100755 --- a/OpenRA.Game/Network/ReplayConnection.cs +++ b/OpenRA.Game/Network/ReplayConnection.cs @@ -11,8 +11,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; namespace OpenRA.Network { diff --git a/OpenRA.Game/Network/ReplayRecorderConnection.cs b/OpenRA.Game/Network/ReplayRecorderConnection.cs index 748e473e5b..2a231c596a 100644 --- a/OpenRA.Game/Network/ReplayRecorderConnection.cs +++ b/OpenRA.Game/Network/ReplayRecorderConnection.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using OpenRA.Widgets; namespace OpenRA.Network diff --git a/OpenRA.Game/Network/Session.cs b/OpenRA.Game/Network/Session.cs index 50ddc471e0..0431c43e85 100644 --- a/OpenRA.Game/Network/Session.cs +++ b/OpenRA.Game/Network/Session.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.FileFormats; @@ -43,11 +42,11 @@ namespace OpenRA.Network break; case "Client": - session.Clients.Add(FieldLoader.Load(y.Value)); + session.Clients.Add(FieldLoader.Load(y.Value)); break; case "Slot": - var s = FieldLoader.Load(y.Value); + var s = FieldLoader.Load(y.Value); session.Slots.Add(s.PlayerReference, s); break; } @@ -144,7 +143,7 @@ namespace OpenRA.Network public Session(string[] mods) { this.GlobalSettings.Mods = mods.ToArray(); - this.GlobalSettings.GameUid = System.Guid.NewGuid().ToString(); + this.GlobalSettings.GameUid = Guid.NewGuid().ToString(); } public string Serialize() diff --git a/OpenRA.Game/Network/SyncReport.cs b/OpenRA.Game/Network/SyncReport.cs index 079ec31138..5270b0427f 100755 --- a/OpenRA.Game/Network/SyncReport.cs +++ b/OpenRA.Game/Network/SyncReport.cs @@ -32,7 +32,7 @@ namespace OpenRA.Network { this.orderManager = orderManager; for (var i = 0; i < NumSyncReports; i++) - syncReports[i] = new SyncReport.Report(); + syncReports[i] = new Report(); } internal void UpdateSyncReport() diff --git a/OpenRA.Game/Network/UPnP.cs b/OpenRA.Game/Network/UPnP.cs index 7676566e31..4929926c53 100644 --- a/OpenRA.Game/Network/UPnP.cs +++ b/OpenRA.Game/Network/UPnP.cs @@ -11,8 +11,6 @@ using System; using Mono.Nat; -using Mono.Nat.Pmp; -using Mono.Nat.Upnp; namespace OpenRA.Network { diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index 250eaaa9fd..c1499d18d2 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -9,9 +9,7 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Orders { diff --git a/OpenRA.Game/Server/Connection.cs b/OpenRA.Game/Server/Connection.cs index 79b3d88a7a..9b75cce8fb 100644 --- a/OpenRA.Game/Server/Connection.cs +++ b/OpenRA.Game/Server/Connection.cs @@ -12,8 +12,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Net.Sockets; -using System.Net.NetworkInformation; -using System.Threading; namespace OpenRA.Server { diff --git a/OpenRA.Game/Server/Exts.cs b/OpenRA.Game/Server/Exts.cs index 5d0d6a71da..5bce5b6943 100755 --- a/OpenRA.Game/Server/Exts.cs +++ b/OpenRA.Game/Server/Exts.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System; namespace OpenRA.Server { diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index c8db24d5cd..23433f5b57 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -340,7 +340,7 @@ namespace OpenRA.Server if (File.Exists("{0}motd_{1}.txt".F(Platform.SupportDir, LobbyInfo.GlobalSettings.Mods[0]))) { - var motd = System.IO.File.ReadAllText("{0}motd_{1}.txt".F(Platform.SupportDir, LobbyInfo.GlobalSettings.Mods[0])); + var motd = File.ReadAllText("{0}motd_{1}.txt".F(Platform.SupportDir, LobbyInfo.GlobalSettings.Mods[0])); SendOrderTo(newConn, "Message", motd); } diff --git a/OpenRA.Game/Sound.cs b/OpenRA.Game/Sound.cs index ae661db21d..161fbb705e 100644 --- a/OpenRA.Game/Sound.cs +++ b/OpenRA.Game/Sound.cs @@ -272,7 +272,7 @@ namespace OpenRA } // Returns true if played successfully - public static bool PlayPredefined(Player p, Actor voicedUnit, string type, string definition, string variant, bool attentuateVolume) + public static bool PlayPredefined(Player p, Actor voicedUnit, string type, string definition, string variant, bool attenuateVolume) { if (definition == null) return false; @@ -323,7 +323,7 @@ namespace OpenRA if (!String.IsNullOrEmpty(name) && (p == null || p == p.World.LocalPlayer)) soundEngine.Play2D(sounds[name], false, true, WPos.Zero, - InternalSoundVolume, attentuateVolume); + InternalSoundVolume, attenuateVolume); return true; } @@ -604,8 +604,8 @@ namespace OpenRA int state; Al.alGetSourcei(b, Al.AL_SOURCE_STATE, out state); return ((state == Al.AL_PLAYING || state == Al.AL_PAUSED) && - ((music != null) ? b != ((OpenAlSound)music).source : true) && - ((video != null) ? b != ((OpenAlSound)video).source : true)); + ((music == null) || b != ((OpenAlSound)music).source) && + ((video == null) || b != ((OpenAlSound)video).source)); }).ToList(); foreach (var s in sounds) { diff --git a/OpenRA.Game/Support/Arguments.cs b/OpenRA.Game/Support/Arguments.cs index 3a33944f00..aed2a634b3 100644 --- a/OpenRA.Game/Support/Arguments.cs +++ b/OpenRA.Game/Support/Arguments.cs @@ -21,11 +21,11 @@ namespace OpenRA public Arguments(params string[] src) { - Regex regex = new Regex("([^=]+)=(.*)"); - foreach (string s in src) + var regex = new Regex("([^=]+)=(.*)"); + foreach (var s in src) { Match m = regex.Match(s); - if (m == null || !m.Success) + if (!m.Success) continue; args[m.Groups[1].Value] = m.Groups[2].Value; diff --git a/OpenRA.Game/Traits/Activity.cs b/OpenRA.Game/Traits/Activity.cs index abef3689df..7ffbd0512f 100644 --- a/OpenRA.Game/Traits/Activity.cs +++ b/OpenRA.Game/Traits/Activity.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; -using System.Text; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/BodyOrientation.cs b/OpenRA.Game/Traits/BodyOrientation.cs index c2fa3cfb98..e81217f442 100755 --- a/OpenRA.Game/Traits/BodyOrientation.cs +++ b/OpenRA.Game/Traits/BodyOrientation.cs @@ -8,10 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Linq; -using OpenRA.Graphics; using OpenRA.FileFormats; namespace OpenRA.Traits diff --git a/OpenRA.Game/Traits/DebugPauseState.cs b/OpenRA.Game/Traits/DebugPauseState.cs index e97dd31404..d7ec732273 100644 --- a/OpenRA.Game/Traits/DebugPauseState.cs +++ b/OpenRA.Game/Traits/DebugPauseState.cs @@ -8,9 +8,6 @@ */ #endregion -using System.Collections.Generic; -using OpenRA.Network; - namespace OpenRA.Traits { public class DebugPauseStateInfo : ITraitInfo diff --git a/OpenRA.Game/Traits/DrawLineToTarget.cs b/OpenRA.Game/Traits/DrawLineToTarget.cs index da846940dc..bbe127aa82 100644 --- a/OpenRA.Game/Traits/DrawLineToTarget.cs +++ b/OpenRA.Game/Traits/DrawLineToTarget.cs @@ -10,7 +10,6 @@ using System.Drawing; using OpenRA.Graphics; -using OpenRA.Effects; using System.Collections.Generic; namespace OpenRA.Traits diff --git a/OpenRA.Game/Traits/Player/DeveloperMode.cs b/OpenRA.Game/Traits/Player/DeveloperMode.cs index fbeed556af..af34cbc68d 100644 --- a/OpenRA.Game/Traits/Player/DeveloperMode.cs +++ b/OpenRA.Game/Traits/Player/DeveloperMode.cs @@ -8,8 +8,6 @@ */ #endregion -using System; - namespace OpenRA.Traits { public class DeveloperModeInfo : ITraitInfo diff --git a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs index 9cb594ca35..c39ed2de71 100755 --- a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs +++ b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs @@ -8,13 +8,10 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/Player/PlayerColorPalette.cs b/OpenRA.Game/Traits/Player/PlayerColorPalette.cs index 646b2993c6..b443b08cc6 100644 --- a/OpenRA.Game/Traits/Player/PlayerColorPalette.cs +++ b/OpenRA.Game/Traits/Player/PlayerColorPalette.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Drawing; using OpenRA.FileFormats; using OpenRA.Graphics; diff --git a/OpenRA.Game/Traits/Player/PlayerResources.cs b/OpenRA.Game/Traits/Player/PlayerResources.cs index 5c953d6355..8a368621bd 100644 --- a/OpenRA.Game/Traits/Player/PlayerResources.cs +++ b/OpenRA.Game/Traits/Player/PlayerResources.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.GameRules; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/RejectsOrders.cs b/OpenRA.Game/Traits/RejectsOrders.cs index c0eb61675c..566f3373c6 100644 --- a/OpenRA.Game/Traits/RejectsOrders.cs +++ b/OpenRA.Game/Traits/RejectsOrders.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using OpenRA.Network; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/Render/RenderSimple.cs b/OpenRA.Game/Traits/Render/RenderSimple.cs index 3ce7c3eb90..4296960f04 100755 --- a/OpenRA.Game/Traits/Render/RenderSimple.cs +++ b/OpenRA.Game/Traits/Render/RenderSimple.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; -using OpenRA.FileFormats; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/Render/RenderSprites.cs b/OpenRA.Game/Traits/Render/RenderSprites.cs index cbd8844d48..10e8ea2246 100755 --- a/OpenRA.Game/Traits/Render/RenderSprites.cs +++ b/OpenRA.Game/Traits/Render/RenderSprites.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; using OpenRA.FileFormats; diff --git a/OpenRA.Game/Traits/SelectionDecorations.cs b/OpenRA.Game/Traits/SelectionDecorations.cs index 42ed416972..87f6178675 100644 --- a/OpenRA.Game/Traits/SelectionDecorations.cs +++ b/OpenRA.Game/Traits/SelectionDecorations.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Drawing; using System.Linq; using OpenRA.Graphics; @@ -65,7 +64,7 @@ namespace OpenRA.Traits return; var pipSources = self.TraitsImplementing(); - if (pipSources.Count() == 0) + if (!pipSources.Any()) return; var pipImages = new Animation("pips"); diff --git a/OpenRA.Game/Traits/Target.cs b/OpenRA.Game/Traits/Target.cs index 0dd0997faa..ee5879d3bb 100644 --- a/OpenRA.Game/Traits/Target.cs +++ b/OpenRA.Game/Traits/Target.cs @@ -32,14 +32,14 @@ namespace OpenRA.Traits public static Target FromOrder(Order o) { return o.TargetActor != null - ? Target.FromActor(o.TargetActor) - : Target.FromCell(o.TargetLocation); + ? FromActor(o.TargetActor) + : FromCell(o.TargetLocation); } public static Target FromActor(Actor a) { if (a == null) - return Target.Invalid; + return Invalid; return new Target { diff --git a/OpenRA.Game/Traits/Util.cs b/OpenRA.Game/Traits/Util.cs index 5e9119e8da..154737f026 100755 --- a/OpenRA.Game/Traits/Util.cs +++ b/OpenRA.Game/Traits/Util.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Support; @@ -135,7 +134,7 @@ namespace OpenRA.Traits public static IEnumerable AdjacentCells(Target target) { var cells = target.Positions.Select(p => p.ToCPos()).Distinct(); - return Util.ExpandFootprint(cells, true); + return ExpandFootprint(cells, true); } } } diff --git a/OpenRA.Game/Traits/World/ActorMap.cs b/OpenRA.Game/Traits/World/ActorMap.cs index ea940a2876..306e70d70a 100644 --- a/OpenRA.Game/Traits/World/ActorMap.cs +++ b/OpenRA.Game/Traits/World/ActorMap.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; -using OpenRA.Traits; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/World/ResourceLayer.cs b/OpenRA.Game/Traits/World/ResourceLayer.cs index 2dcd437902..54bbe37a44 100644 --- a/OpenRA.Game/Traits/World/ResourceLayer.cs +++ b/OpenRA.Game/Traits/World/ResourceLayer.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Graphics; diff --git a/OpenRA.Game/Traits/World/ScreenMap.cs b/OpenRA.Game/Traits/World/ScreenMap.cs index 6b102bff94..6cc274a4dc 100755 --- a/OpenRA.Game/Traits/World/ScreenMap.cs +++ b/OpenRA.Game/Traits/World/ScreenMap.cs @@ -14,7 +14,6 @@ using System.Drawing; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index 27ab347083..d53f8eeaa7 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.Graphics; namespace OpenRA.Traits { diff --git a/OpenRA.Game/Widgets/BackgroundWidget.cs b/OpenRA.Game/Widgets/BackgroundWidget.cs index d7e9589437..7bb94f2ee4 100644 --- a/OpenRA.Game/Widgets/BackgroundWidget.cs +++ b/OpenRA.Game/Widgets/BackgroundWidget.cs @@ -23,7 +23,7 @@ namespace OpenRA.Widgets WidgetUtils.DrawPanel(Background, RenderBounds); } - public BackgroundWidget() : base() { } + public BackgroundWidget() { } bool moving; int2? prevMouseLocation; diff --git a/OpenRA.Game/Widgets/ButtonWidget.cs b/OpenRA.Game/Widgets/ButtonWidget.cs index a14d548487..4b3b6c7389 100644 --- a/OpenRA.Game/Widgets/ButtonWidget.cs +++ b/OpenRA.Game/Widgets/ButtonWidget.cs @@ -9,10 +9,8 @@ #endregion using System; -using System.Collections.Generic; using System.Drawing; using OpenRA.FileFormats; -using OpenRA.Graphics; namespace OpenRA.Widgets { @@ -48,7 +46,6 @@ namespace OpenRA.Widgets public Action OnKeyPress = _ => {}; public ButtonWidget() - : base() { GetText = () => { return Text; }; OnMouseUp = _ => OnClick(); @@ -188,7 +185,7 @@ namespace OpenRA.Widgets public virtual void DrawBackground(Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted) { - ButtonWidget.DrawBackground("button", rect, disabled, pressed, hover, highlighted); + DrawBackground("button", rect, disabled, pressed, hover, highlighted); } public static void DrawBackground(string baseName, Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted) diff --git a/OpenRA.Game/Widgets/ChatDisplayWidget.cs b/OpenRA.Game/Widgets/ChatDisplayWidget.cs index 04e140ea73..ea0ecda348 100644 --- a/OpenRA.Game/Widgets/ChatDisplayWidget.cs +++ b/OpenRA.Game/Widgets/ChatDisplayWidget.cs @@ -26,9 +26,6 @@ namespace OpenRA.Widgets internal List recentLines = new List(); - public ChatDisplayWidget() - : base() { } - public override Rectangle EventBounds { get { return Rectangle.Empty; } } public override void Draw() diff --git a/OpenRA.Game/Widgets/CheckboxWidget.cs b/OpenRA.Game/Widgets/CheckboxWidget.cs index e2378a2a7d..f6bfd941b9 100644 --- a/OpenRA.Game/Widgets/CheckboxWidget.cs +++ b/OpenRA.Game/Widgets/CheckboxWidget.cs @@ -11,7 +11,6 @@ using System; using System.Drawing; using OpenRA.Graphics; -using System.Reflection; namespace OpenRA.Widgets { @@ -25,7 +24,6 @@ namespace OpenRA.Widgets public bool HasPressedState = ChromeMetrics.Get("CheckboxPressedState"); public CheckboxWidget() - : base() { GetCheckType = () => CheckType; } diff --git a/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs b/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs index d487ea51ae..09d0a906bb 100644 --- a/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs +++ b/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs @@ -8,13 +8,7 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Threading; using OpenRA.FileFormats; -using OpenRA.Graphics; using OpenRA.Network; namespace OpenRA.Widgets @@ -27,7 +21,7 @@ namespace OpenRA.Widgets OrderManager orderManager; int clientIndex; - public ClientTooltipRegionWidget() : base() + public ClientTooltipRegionWidget() { tooltipContainer = Lazy.New(() => Ui.Root.Get(TooltipContainer)); } diff --git a/OpenRA.Game/Widgets/ColorBlockWidget.cs b/OpenRA.Game/Widgets/ColorBlockWidget.cs index 4a1c64e2f2..c27f19f6bf 100644 --- a/OpenRA.Game/Widgets/ColorBlockWidget.cs +++ b/OpenRA.Game/Widgets/ColorBlockWidget.cs @@ -18,7 +18,6 @@ namespace OpenRA.Widgets public Func GetColor; public ColorBlockWidget() - : base() { GetColor = () => Color.White; } diff --git a/OpenRA.Game/Widgets/DropDownButtonWidget.cs b/OpenRA.Game/Widgets/DropDownButtonWidget.cs index 96a5e35cc4..ca3ae8aba0 100644 --- a/OpenRA.Game/Widgets/DropDownButtonWidget.cs +++ b/OpenRA.Game/Widgets/DropDownButtonWidget.cs @@ -20,7 +20,7 @@ namespace OpenRA.Widgets Widget panel; MaskWidget fullscreenMask; - public DropDownButtonWidget() : base() { } + public DropDownButtonWidget() { } protected DropDownButtonWidget(DropDownButtonWidget widget) : base(widget) { } @@ -145,7 +145,7 @@ namespace OpenRA.Widgets public class MaskWidget : Widget { public event Action OnMouseDown = _ => {}; - public MaskWidget() : base() { } + public MaskWidget() { } public MaskWidget(MaskWidget other) : base(other) { diff --git a/OpenRA.Game/Widgets/HotkeyEntryWidget.cs b/OpenRA.Game/Widgets/HotkeyEntryWidget.cs index bbb693f226..93ba40f735 100644 --- a/OpenRA.Game/Widgets/HotkeyEntryWidget.cs +++ b/OpenRA.Game/Widgets/HotkeyEntryWidget.cs @@ -11,8 +11,6 @@ using System; using System.Drawing; using System.Linq; -using OpenRA.Traits; -using OpenRA.Graphics; namespace OpenRA.Widgets { @@ -31,7 +29,7 @@ namespace OpenRA.Widgets public Color DisabledColor = Color.Gray; public string Font = "Regular"; - public HotkeyEntryWidget() : base() {} + public HotkeyEntryWidget() {} protected HotkeyEntryWidget(HotkeyEntryWidget widget) : base(widget) { diff --git a/OpenRA.Game/Widgets/ImageWidget.cs b/OpenRA.Game/Widgets/ImageWidget.cs index f9f323b3de..5c5eeadce0 100644 --- a/OpenRA.Game/Widgets/ImageWidget.cs +++ b/OpenRA.Game/Widgets/ImageWidget.cs @@ -21,7 +21,6 @@ namespace OpenRA.Widgets public Func GetImageCollection; public ImageWidget() - : base() { GetImageName = () => ImageName; GetImageCollection = () => ImageCollection; diff --git a/OpenRA.Game/Widgets/LabelWidget.cs b/OpenRA.Game/Widgets/LabelWidget.cs index 230f0ed955..d4546a9890 100644 --- a/OpenRA.Game/Widgets/LabelWidget.cs +++ b/OpenRA.Game/Widgets/LabelWidget.cs @@ -33,7 +33,6 @@ namespace OpenRA.Widgets public Func GetContrastColor; public LabelWidget() - : base() { GetText = () => Text; GetColor = () => Color; diff --git a/OpenRA.Game/Widgets/LineGraphWidget.cs b/OpenRA.Game/Widgets/LineGraphWidget.cs index 50351b81b4..f75390a18f 100644 --- a/OpenRA.Game/Widgets/LineGraphWidget.cs +++ b/OpenRA.Game/Widgets/LineGraphWidget.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.FileFormats; namespace OpenRA.Widgets { @@ -41,7 +40,6 @@ namespace OpenRA.Widgets public string AxisFont; public LineGraphWidget() - : base() { GetValueFormat = () => ValueFormat; GetXAxisValueFormat = () => XAxisValueFormat; diff --git a/OpenRA.Game/Widgets/MapPreviewWidget.cs b/OpenRA.Game/Widgets/MapPreviewWidget.cs index 9d98e38244..d386f359fc 100644 --- a/OpenRA.Game/Widgets/MapPreviewWidget.cs +++ b/OpenRA.Game/Widgets/MapPreviewWidget.cs @@ -32,7 +32,7 @@ namespace OpenRA.Widgets Lazy tooltipContainer; public int TooltipSpawnIndex = -1; - public MapPreviewWidget() : base() + public MapPreviewWidget() { tooltipContainer = Lazy.New(() => Ui.Root.Get(TooltipContainer)); } diff --git a/OpenRA.Game/Widgets/PasswordFieldWidget.cs b/OpenRA.Game/Widgets/PasswordFieldWidget.cs index 1e180945dc..72c6c878ce 100644 --- a/OpenRA.Game/Widgets/PasswordFieldWidget.cs +++ b/OpenRA.Game/Widgets/PasswordFieldWidget.cs @@ -12,7 +12,7 @@ namespace OpenRA.Widgets { public class PasswordFieldWidget : TextFieldWidget { - public PasswordFieldWidget() : base() { } + public PasswordFieldWidget() { } protected PasswordFieldWidget(PasswordFieldWidget widget) : base(widget) { } protected override string GetApparentText() { return new string('*', Text.Length); } diff --git a/OpenRA.Game/Widgets/PerfGraphWidget.cs b/OpenRA.Game/Widgets/PerfGraphWidget.cs index e72fe4c5e0..47428ef8b8 100644 --- a/OpenRA.Game/Widgets/PerfGraphWidget.cs +++ b/OpenRA.Game/Widgets/PerfGraphWidget.cs @@ -16,8 +16,6 @@ namespace OpenRA.Widgets { public class PerfGraphWidget : Widget { - public PerfGraphWidget() : base() { } - public override void Draw() { var rect = RenderBounds; diff --git a/OpenRA.Game/Widgets/ProgressBarWidget.cs b/OpenRA.Game/Widgets/ProgressBarWidget.cs index 8114476131..13b9ff54d1 100644 --- a/OpenRA.Game/Widgets/ProgressBarWidget.cs +++ b/OpenRA.Game/Widgets/ProgressBarWidget.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; namespace OpenRA.Widgets @@ -22,7 +21,7 @@ namespace OpenRA.Widgets float offset = 0f; float tickStep = 0.04f; - public ProgressBarWidget() : base() {} + public ProgressBarWidget() {} protected ProgressBarWidget(ProgressBarWidget widget) : base(widget) { diff --git a/OpenRA.Game/Widgets/ScrollItemWidget.cs b/OpenRA.Game/Widgets/ScrollItemWidget.cs index 717db47cb6..7f597f5ae8 100644 --- a/OpenRA.Game/Widgets/ScrollItemWidget.cs +++ b/OpenRA.Game/Widgets/ScrollItemWidget.cs @@ -18,7 +18,6 @@ namespace OpenRA.Widgets public string BaseName = "scrollitem"; public ScrollItemWidget() - : base() { IsVisible = () => false; VisualHeight = 0; diff --git a/OpenRA.Game/Widgets/ScrollPanelWidget.cs b/OpenRA.Game/Widgets/ScrollPanelWidget.cs index 878402c79a..dcc2d3c8d5 100644 --- a/OpenRA.Game/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Game/Widgets/ScrollPanelWidget.cs @@ -41,7 +41,7 @@ namespace OpenRA.Widgets protected Rectangle scrollbarRect; protected Rectangle thumbRect; - public ScrollPanelWidget() : base() { Layout = new ListLayout(this); } + public ScrollPanelWidget() { Layout = new ListLayout(this); } public override void RemoveChildren() { diff --git a/OpenRA.Game/Widgets/ShpImageWidget.cs b/OpenRA.Game/Widgets/ShpImageWidget.cs index f7842aa5fa..4c8cb912a7 100644 --- a/OpenRA.Game/Widgets/ShpImageWidget.cs +++ b/OpenRA.Game/Widgets/ShpImageWidget.cs @@ -28,7 +28,6 @@ namespace OpenRA.Widgets [ObjectCreator.UseCtor] public ShpImageWidget(WorldRenderer worldRenderer) - : base() { GetImage = () => { return Image; }; GetFrame = () => { return Frame; }; diff --git a/OpenRA.Game/Widgets/SliderWidget.cs b/OpenRA.Game/Widgets/SliderWidget.cs index 8b9a05680f..b080386c5a 100755 --- a/OpenRA.Game/Widgets/SliderWidget.cs +++ b/OpenRA.Game/Widgets/SliderWidget.cs @@ -29,7 +29,6 @@ namespace OpenRA.Widgets protected bool isMoving = false; public SliderWidget() - : base() { GetValue = () => Value; } diff --git a/OpenRA.Game/Widgets/TextFieldWidget.cs b/OpenRA.Game/Widgets/TextFieldWidget.cs index b9dc51cd05..de1125b588 100644 --- a/OpenRA.Game/Widgets/TextFieldWidget.cs +++ b/OpenRA.Game/Widgets/TextFieldWidget.cs @@ -10,8 +10,6 @@ using System; using System.Drawing; -using OpenRA.Traits; -using OpenRA.Graphics; namespace OpenRA.Widgets { @@ -40,7 +38,7 @@ namespace OpenRA.Widgets public Color DisabledColor = Color.Gray; public string Font = "Regular"; - public TextFieldWidget() : base() {} + public TextFieldWidget() {} protected TextFieldWidget(TextFieldWidget widget) : base(widget) { diff --git a/OpenRA.Game/Widgets/TooltipContainerWidget.cs b/OpenRA.Game/Widgets/TooltipContainerWidget.cs index d8fe7f8408..086eda10a5 100644 --- a/OpenRA.Game/Widgets/TooltipContainerWidget.cs +++ b/OpenRA.Game/Widgets/TooltipContainerWidget.cs @@ -8,12 +8,8 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Widgets; using System; namespace OpenRA.Widgets diff --git a/OpenRA.Game/Widgets/ViewportControllerWidget.cs b/OpenRA.Game/Widgets/ViewportControllerWidget.cs index 65d4fafaf1..06b63e7da0 100644 --- a/OpenRA.Game/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Game/Widgets/ViewportControllerWidget.cs @@ -61,7 +61,6 @@ namespace OpenRA.Widgets [ObjectCreator.UseCtor] public ViewportControllerWidget(World world, WorldRenderer worldRenderer) - : base() { this.world = world; this.worldRenderer = worldRenderer; diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 2d662087f0..b66990fb39 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -446,7 +446,7 @@ namespace OpenRA.Widgets public class ContainerWidget : Widget { - public ContainerWidget() : base() { IgnoreMouseOver = true; } + public ContainerWidget() { IgnoreMouseOver = true; } public ContainerWidget(ContainerWidget other) : base(other) { IgnoreMouseOver = true; } @@ -458,7 +458,7 @@ namespace OpenRA.Widgets public class WidgetArgs : Dictionary { - public WidgetArgs() : base() { } + public WidgetArgs() { } public WidgetArgs(Dictionary args) : base(args) { } public void Add(string key, Action val) { base.Add(key, val); } } diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index ad5503408d..b2dec7acef 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -57,8 +57,8 @@ namespace OpenRA.Widgets var useClassicMouseStyle = Game.Settings.Game.UseClassicMouseStyle; - var hasBox = (SelectionBox != null) ? true : false; - var multiClick = (mi.MultiTapCount >= 2) ? true : false; + var hasBox = SelectionBox != null; + var multiClick = mi.MultiTapCount >= 2; if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down) { @@ -68,7 +68,7 @@ namespace OpenRA.Widgets dragStart = dragEnd = xy; // place buildings - if (!useClassicMouseStyle || (useClassicMouseStyle && !World.Selection.Actors.Any())) + if (!useClassicMouseStyle || !World.Selection.Actors.Any()) ApplyOrders(World, xy, mi); } diff --git a/OpenRA.Game/WorldUtils.cs b/OpenRA.Game/WorldUtils.cs index e52195228f..db9d5f9c6c 100755 --- a/OpenRA.Game/WorldUtils.cs +++ b/OpenRA.Game/WorldUtils.cs @@ -91,7 +91,7 @@ namespace OpenRA public static string GetTerrainType(this World world, CPos cell) { var custom = world.Map.CustomTerrain[cell.X, cell.Y]; - return custom != null ? custom : world.TileSet.GetTerrainType(world.Map.MapTiles.Value[cell.X, cell.Y]); + return custom ?? world.TileSet.GetTerrainType(world.Map.MapTiles.Value[cell.X, cell.Y]); } public static TerrainTypeInfo GetTerrainInfo(this World world, CPos cell) diff --git a/OpenRA.Lint/YamlChecker.cs b/OpenRA.Lint/YamlChecker.cs index 9416a990fa..08e12090ab 100644 --- a/OpenRA.Lint/YamlChecker.cs +++ b/OpenRA.Lint/YamlChecker.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA; using OpenRA.FileFormats; using OpenRA.Traits; diff --git a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs index b990eb7f8a..d279af21f4 100644 --- a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs +++ b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs @@ -18,7 +18,6 @@ using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Move; using OpenRA.Scripting; using OpenRA.Traits; -using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Missions { diff --git a/OpenRA.Mods.Cnc/Missions/Nod01Script.cs b/OpenRA.Mods.Cnc/Missions/Nod01Script.cs index b9768b8721..b9d667360a 100644 --- a/OpenRA.Mods.Cnc/Missions/Nod01Script.cs +++ b/OpenRA.Mods.Cnc/Missions/Nod01Script.cs @@ -13,10 +13,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.Cnc; using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Air; using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Missions; using OpenRA.Mods.RA.Move; diff --git a/OpenRA.Mods.Cnc/RenderGunboat.cs b/OpenRA.Mods.Cnc/RenderGunboat.cs index 21f6f26dba..55654b921d 100644 --- a/OpenRA.Mods.Cnc/RenderGunboat.cs +++ b/OpenRA.Mods.Cnc/RenderGunboat.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; diff --git a/OpenRA.Mods.Cnc/Widgets/CncWidgetUtils.cs b/OpenRA.Mods.Cnc/Widgets/CncWidgetUtils.cs index 6469ee38db..f95e3585cf 100644 --- a/OpenRA.Mods.Cnc/Widgets/CncWidgetUtils.cs +++ b/OpenRA.Mods.Cnc/Widgets/CncWidgetUtils.cs @@ -9,8 +9,6 @@ #endregion using System; -using System.Linq; -using OpenRA.FileFormats; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncInstallMusicLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncInstallMusicLogic.cs index 75dc4501ba..8938ea67a4 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncInstallMusicLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncInstallMusicLogic.cs @@ -12,9 +12,7 @@ using System; using System.IO; using System.Linq; using OpenRA.FileFormats; -using OpenRA.GameRules; using OpenRA.Mods.RA.Widgets.Logic; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTabsLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTabsLogic.cs index c8165241ee..68dfedd140 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTabsLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTabsLogic.cs @@ -9,10 +9,6 @@ #endregion using System; -using System.Drawing; -using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Orders; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets.Logic diff --git a/OpenRA.Mods.Cnc/Widgets/ProductionTypeButtonWidget.cs b/OpenRA.Mods.Cnc/Widgets/ProductionTypeButtonWidget.cs index 6cb77cfeee..aee708e16d 100644 --- a/OpenRA.Mods.Cnc/Widgets/ProductionTypeButtonWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/ProductionTypeButtonWidget.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using System.Drawing; -using OpenRA.FileFormats; using OpenRA.Widgets; namespace OpenRA.Mods.Cnc.Widgets @@ -19,7 +16,7 @@ namespace OpenRA.Mods.Cnc.Widgets { public readonly string ProductionGroup; - public ProductionTypeButtonWidget() : base() { } + public ProductionTypeButtonWidget() { } protected ProductionTypeButtonWidget(ProductionTypeButtonWidget other) : base(other) { diff --git a/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs b/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs index 66587c07cd..dec4cd1389 100755 --- a/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.Linq; diff --git a/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs b/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs index a22f666ba5..709bfe6e48 100644 --- a/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs +++ b/OpenRA.Mods.D2k/Render/WithCrumbleOverlay.cs @@ -11,7 +11,6 @@ using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; -using OpenRA.Mods.RA.Buildings; namespace OpenRA.Mods.RA.Render { diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs index 4aa3b87da5..13a16459d3 100644 --- a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs @@ -13,7 +13,6 @@ using System.IO; using System.Linq; using System.Threading; using OpenRA.FileFormats; -using OpenRA.FileFormats.Graphics; using OpenRA.Widgets; namespace OpenRA.Mods.D2k.Widgets.Logic diff --git a/OpenRA.Mods.RA/AI/HackyAI.cs b/OpenRA.Mods.RA/AI/HackyAI.cs index 553e53b662..0de0905132 100644 --- a/OpenRA.Mods.RA/AI/HackyAI.cs +++ b/OpenRA.Mods.RA/AI/HackyAI.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; +using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Air; using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Move; @@ -51,13 +52,13 @@ namespace OpenRA.Mods.RA.AI [FieldLoader.LoadUsing("LoadBuildingLimits")] public readonly Dictionary BuildingLimits = null; - static object LoadList(MiniYaml y, string field) + static object LoadList(MiniYaml y, string field) { return y.NodesDict.ContainsKey(field) ? y.NodesDict[field].NodesDict.ToDictionary( a => a.Key, - a => FieldLoader.GetValue(field, a.Value.Value)) - : new Dictionary(); + a => FieldLoader.GetValue(field, a.Value.Value)) + : new Dictionary(); } static object LoadUnits(MiniYaml y) { return LoadList(y, "UnitsToBuild"); } @@ -77,8 +78,6 @@ namespace OpenRA.Mods.RA.AI public class HackyAI : ITick, IBot, INotifyDamage { - static readonly List NoActors = new List(); - bool enabled; public int ticks; public Player p; @@ -181,15 +180,13 @@ namespace OpenRA.Mods.RA.AI int CountBuilding(string frac, Player owner) { return world.ActorsWithTrait() - .Where(a => a.Actor.Owner == owner && a.Actor.Info.Name == frac) - .Count(); + .Count(a => a.Actor.Owner == owner && a.Actor.Info.Name == frac); } int CountUnits(string unit, Player owner) { return world.ActorsWithTrait() - .Where(a => a.Actor.Owner == owner && a.Actor.Info.Name == unit) - .Count(); + .Count(a => a.Actor.Owner == owner && a.Actor.Info.Name == unit); } int? CountBuildingByCommonName(string commonName, Player owner) @@ -198,8 +195,7 @@ namespace OpenRA.Mods.RA.AI return null; return world.ActorsWithTrait() - .Where(a => a.Actor.Owner == owner && Info.BuildingCommonNames[commonName].Contains(a.Actor.Info.Name)) - .Count(); + .Count(a => a.Actor.Owner == owner && Info.BuildingCommonNames[commonName].Contains(a.Actor.Info.Name)); } ActorInfo GetBuildingInfoByCommonName(string commonName, Player owner) @@ -467,10 +463,8 @@ namespace OpenRA.Mods.RA.AI List FindEnemyConstructionYards() { - var bases = world.Actors.Where(a => p.Stances[a.Owner] == Stance.Enemy && !a.Destroyed + return world.Actors.Where(a => p.Stances[a.Owner] == Stance.Enemy && !a.IsDead() && a.HasTrait() && !a.HasTrait()).ToList(); - - return bases ?? NoActors; } Actor FindEnemyBuildingClosestToPos(WPos pos) @@ -491,7 +485,7 @@ namespace OpenRA.Mods.RA.AI // Use of this function requires that one squad of this type. Hence it is a piece of shit Squad GetSquadOfType(SquadType type) { - return squads.Where(s => s.type == type).FirstOrDefault(); + return squads.FirstOrDefault(s => s.type == type); } Squad RegisterNewSquad(SquadType type, Actor target) @@ -553,8 +547,8 @@ namespace OpenRA.Mods.RA.AI var act = a.GetCurrentActivity(); // A Wait activity is technically idle: - if ((act.GetType() != typeof(OpenRA.Mods.RA.Activities.Wait)) && - (act.NextActivity == null || act.NextActivity.GetType() != typeof(OpenRA.Mods.RA.Activities.FindResources))) + if ((act.GetType() != typeof(Wait)) && + (act.NextActivity == null || act.NextActivity.GetType() != typeof(FindResources))) continue; } @@ -623,12 +617,12 @@ namespace OpenRA.Mods.RA.AI foreach (var b in allEnemyBaseBuilder) { - var enemys = world.FindActorsInCircle(b.CenterPosition, WRange.FromCells(15)) + var enemies = world.FindActorsInCircle(b.CenterPosition, WRange.FromCells(15)) .Where(unit => p.Stances[unit.Owner] == Stance.Enemy && unit.HasTrait()).ToList(); - if (rushFuzzy.CanAttack(ownUnits, enemys)) + if (rushFuzzy.CanAttack(ownUnits, enemies)) { - var target = enemys.Any() ? enemys.Random(random) : b; + var target = enemies.Any() ? enemies.Random(random) : b; var rush = GetSquadOfType(SquadType.Rush); if (rush == null) rush = RegisterNewSquad(SquadType.Rush, target); @@ -783,16 +777,16 @@ namespace OpenRA.Mods.RA.AI { var pos = new CPos(i, j); var targets = world.FindActorsInCircle(pos.CenterPosition, WRange.FromCells(radiusOfPower)).ToList(); - var enemys = targets.Where(unit => p.Stances[unit.Owner] == Stance.Enemy).ToList(); + var enemies = targets.Where(unit => p.Stances[unit.Owner] == Stance.Enemy).ToList(); var ally = targets.Where(unit => p.Stances[unit.Owner] == Stance.Ally || unit.Owner == p).ToList(); - if (enemys.Count < ally.Count || !enemys.Any()) + if (enemies.Count < ally.Count || !enemies.Any()) continue; - if (enemys.Count > countUnits) + if (enemies.Count > countUnits) { - countUnits = enemys.Count; - resLoc = enemys.Random(random).Location; + countUnits = enemies.Count; + resLoc = enemies.Random(random).Location; } } } @@ -814,7 +808,7 @@ namespace OpenRA.Mods.RA.AI return; // No construction yards - Build a new MCV - if (!HasAdequateFact() && !self.World.Actors.Where(a => a.Owner == p && a.HasTrait() && a.HasTrait()).Any()) + if (!HasAdequateFact() && !self.World.Actors.Any(a => a.Owner == p && a.HasTrait() && a.HasTrait())) BuildUnit("Vehicle", GetUnitInfoByCommonName("Mcv", p).Name); foreach (var q in Info.UnitQueues) diff --git a/OpenRA.Mods.RA/AI/RushFuzzy.cs b/OpenRA.Mods.RA/AI/RushFuzzy.cs index afe43e8624..25e7ac59d6 100644 --- a/OpenRA.Mods.RA/AI/RushFuzzy.cs +++ b/OpenRA.Mods.RA/AI/RushFuzzy.cs @@ -12,8 +12,6 @@ namespace OpenRA.Mods.RA.AI { class RushFuzzy : AttackOrFleeFuzzy { - public RushFuzzy() : base() { } - protected override void AddingRulesForNormalOwnHealth() { AddFuzzyRule("if ((OwnHealth is Normal) " + diff --git a/OpenRA.Mods.RA/AI/Squad.cs b/OpenRA.Mods.RA/AI/Squad.cs index 1ea59d8c45..a882da1dbe 100644 --- a/OpenRA.Mods.RA/AI/Squad.cs +++ b/OpenRA.Mods.RA/AI/Squad.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Traits; using XRandom = OpenRA.Thirdparty.Random; diff --git a/OpenRA.Mods.RA/AI/States/AirStates.cs b/OpenRA.Mods.RA/AI/States/AirStates.cs index 99d7a7dcb1..685347504b 100644 --- a/OpenRA.Mods.RA/AI/States/AirStates.cs +++ b/OpenRA.Mods.RA/AI/States/AirStates.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Linq; +using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Air; using OpenRA.Traits; @@ -125,7 +126,7 @@ namespace OpenRA.Mods.RA.AI return false; var type = activity.GetType(); - if (type == typeof(OpenRA.Mods.RA.Activities.Rearm) || type == typeof(ResupplyAircraft)) + if (type == typeof(Rearm) || type == typeof(ResupplyAircraft)) return true; var next = activity.NextActivity; @@ -133,7 +134,7 @@ namespace OpenRA.Mods.RA.AI return false; var nextType = next.GetType(); - if (nextType == typeof(OpenRA.Mods.RA.Activities.Rearm) || nextType == typeof(ResupplyAircraft)) + if (nextType == typeof(Rearm) || nextType == typeof(ResupplyAircraft)) return true; return false; diff --git a/OpenRA.Mods.RA/AI/States/GroundStates.cs b/OpenRA.Mods.RA/AI/States/GroundStates.cs index 1846c9758b..b74640ba8d 100644 --- a/OpenRA.Mods.RA/AI/States/GroundStates.cs +++ b/OpenRA.Mods.RA/AI/States/GroundStates.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Linq; using OpenRA.Traits; @@ -94,9 +93,9 @@ namespace OpenRA.Mods.RA.AI } else { - var enemys = owner.world.FindActorsInCircle(leader.CenterPosition, WRange.FromCells(12)) + var enemies = owner.world.FindActorsInCircle(leader.CenterPosition, WRange.FromCells(12)) .Where(a1 => !a1.Destroyed && !a1.IsDead()).ToList(); - var enemynearby = enemys.Where(a1 => a1.HasTrait() && leader.Owner.Stances[a1.Owner] == Stance.Enemy).ToList(); + var enemynearby = enemies.Where(a1 => a1.HasTrait() && leader.Owner.Stances[a1.Owner] == Stance.Enemy).ToList(); if (enemynearby.Any()) { owner.Target = enemynearby.ClosestTo(leader.CenterPosition); diff --git a/OpenRA.Mods.RA/AI/States/ProtectionStates.cs b/OpenRA.Mods.RA/AI/States/ProtectionStates.cs index ff40ec8219..582a9e847b 100644 --- a/OpenRA.Mods.RA/AI/States/ProtectionStates.cs +++ b/OpenRA.Mods.RA/AI/States/ProtectionStates.cs @@ -8,10 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; -using OpenRA.Traits; - namespace OpenRA.Mods.RA.AI { class UnitsForProtectionIdleState : GroundStateBase, IState diff --git a/OpenRA.Mods.RA/AI/States/StateBase.cs b/OpenRA.Mods.RA/AI/States/StateBase.cs index 040349b17a..c92e3dae0b 100644 --- a/OpenRA.Mods.RA/AI/States/StateBase.cs +++ b/OpenRA.Mods.RA/AI/States/StateBase.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; using System.Linq; +using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Air; using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; @@ -44,7 +45,7 @@ namespace OpenRA.Mods.RA.AI return false; var type = a.GetCurrentActivity().GetType(); - if (type == typeof(OpenRA.Mods.RA.Activities.Attack) || type == typeof(FlyAttack)) + if (type == typeof(Attack) || type == typeof(FlyAttack)) return true; var next = a.GetCurrentActivity().NextActivity; @@ -52,7 +53,7 @@ namespace OpenRA.Mods.RA.AI return false; var nextType = a.GetCurrentActivity().NextActivity.GetType(); - if (nextType == typeof(OpenRA.Mods.RA.Activities.Attack) || nextType == typeof(FlyAttack)) + if (nextType == typeof(Attack) || nextType == typeof(FlyAttack)) return true; return false; diff --git a/OpenRA.Mods.RA/Activities/Attack.cs b/OpenRA.Mods.RA/Activities/Attack.cs index 8be668ed38..53a763ffef 100755 --- a/OpenRA.Mods.RA/Activities/Attack.cs +++ b/OpenRA.Mods.RA/Activities/Attack.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Mods.RA.Render; using OpenRA.Traits; using OpenRA.Mods.RA.Move; diff --git a/OpenRA.Mods.RA/Activities/CallFunc.cs b/OpenRA.Mods.RA/Activities/CallFunc.cs index 24b74e095f..8ad9d42fc4 100644 --- a/OpenRA.Mods.RA/Activities/CallFunc.cs +++ b/OpenRA.Mods.RA/Activities/CallFunc.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities diff --git a/OpenRA.Mods.RA/Activities/CaptureActor.cs b/OpenRA.Mods.RA/Activities/CaptureActor.cs index 11b8a2680b..e0118954d4 100644 --- a/OpenRA.Mods.RA/Activities/CaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/CaptureActor.cs @@ -8,9 +8,7 @@ */ #endregion -using System.Linq; using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Move; using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities diff --git a/OpenRA.Mods.RA/Activities/DeliverResources.cs b/OpenRA.Mods.RA/Activities/DeliverResources.cs index 0e865827bc..a37d2b5846 100755 --- a/OpenRA.Mods.RA/Activities/DeliverResources.cs +++ b/OpenRA.Mods.RA/Activities/DeliverResources.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using System.Drawing; using OpenRA.Traits; using OpenRA.Mods.RA.Move; @@ -22,8 +21,6 @@ namespace OpenRA.Mods.RA.Activities const int NextChooseTime = 100; - public DeliverResources() { } - public override Activity Tick(Actor self) { if (NextActivity != null) diff --git a/OpenRA.Mods.RA/Activities/DonateSupplies.cs b/OpenRA.Mods.RA/Activities/DonateSupplies.cs index 5c8e7d88f9..3da95226f5 100644 --- a/OpenRA.Mods.RA/Activities/DonateSupplies.cs +++ b/OpenRA.Mods.RA/Activities/DonateSupplies.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; using OpenRA.Mods.RA.Effects; diff --git a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs index 77c1bd7cf2..8d56c20ca3 100644 --- a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs @@ -8,11 +8,9 @@ */ #endregion -using System.Linq; using OpenRA.Traits; using OpenRA.Effects; using OpenRA.Mods.RA.Move; -using OpenRA.Mods.RA.Buildings; namespace OpenRA.Mods.RA.Activities { diff --git a/OpenRA.Mods.RA/Activities/FindResources.cs b/OpenRA.Mods.RA/Activities/FindResources.cs index 45513d0448..4942555a3c 100755 --- a/OpenRA.Mods.RA/Activities/FindResources.cs +++ b/OpenRA.Mods.RA/Activities/FindResources.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Mods.RA.Move; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; using System; diff --git a/OpenRA.Mods.RA/Activities/Heal.cs b/OpenRA.Mods.RA/Activities/Heal.cs index 15da403012..660337a952 100755 --- a/OpenRA.Mods.RA/Activities/Heal.cs +++ b/OpenRA.Mods.RA/Activities/Heal.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Mods.RA.Move; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities diff --git a/OpenRA.Mods.RA/Activities/Infiltrate.cs b/OpenRA.Mods.RA/Activities/Infiltrate.cs index 9baad5547f..1288e5bf8d 100644 --- a/OpenRA.Mods.RA/Activities/Infiltrate.cs +++ b/OpenRA.Mods.RA/Activities/Infiltrate.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Activities/RepairBridge.cs b/OpenRA.Mods.RA/Activities/RepairBridge.cs index 178eea6ce3..c3e5f7e116 100644 --- a/OpenRA.Mods.RA/Activities/RepairBridge.cs +++ b/OpenRA.Mods.RA/Activities/RepairBridge.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities diff --git a/OpenRA.Mods.RA/Activities/RepairBuilding.cs b/OpenRA.Mods.RA/Activities/RepairBuilding.cs index c5c13fafbe..9580e7e7dd 100644 --- a/OpenRA.Mods.RA/Activities/RepairBuilding.cs +++ b/OpenRA.Mods.RA/Activities/RepairBuilding.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities diff --git a/OpenRA.Mods.RA/Activities/Sell.cs b/OpenRA.Mods.RA/Activities/Sell.cs index 2222cedacf..c3cbab0814 100755 --- a/OpenRA.Mods.RA/Activities/Sell.cs +++ b/OpenRA.Mods.RA/Activities/Sell.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using OpenRA.Traits; using OpenRA.Mods.RA.Effects; using OpenRA.Mods.RA.Buildings; diff --git a/OpenRA.Mods.RA/Activities/Teleport.cs b/OpenRA.Mods.RA/Activities/Teleport.cs index 99ce99e4ee..1d044b0466 100755 --- a/OpenRA.Mods.RA/Activities/Teleport.cs +++ b/OpenRA.Mods.RA/Activities/Teleport.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; using OpenRA.Mods.RA.Render; diff --git a/OpenRA.Mods.RA/Activities/Turn.cs b/OpenRA.Mods.RA/Activities/Turn.cs index 83d7d2016f..1831675494 100755 --- a/OpenRA.Mods.RA/Activities/Turn.cs +++ b/OpenRA.Mods.RA/Activities/Turn.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities diff --git a/OpenRA.Mods.RA/ActorExts.cs b/OpenRA.Mods.RA/ActorExts.cs index 94bd74eed4..33ff923b62 100644 --- a/OpenRA.Mods.RA/ActorExts.cs +++ b/OpenRA.Mods.RA/ActorExts.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Air/Aircraft.cs b/OpenRA.Mods.RA/Air/Aircraft.cs index e96664438a..75765c97eb 100755 --- a/OpenRA.Mods.RA/Air/Aircraft.cs +++ b/OpenRA.Mods.RA/Air/Aircraft.cs @@ -144,7 +144,7 @@ namespace OpenRA.Mods.RA.Air } public bool CanEnterCell(CPos location) { return true; } - public bool CanEnterCell(CPos cell, Actor ignoreActor, bool checkTransientActors) { return CanEnterCell(cell, null, true); } + public bool CanEnterCell(CPos cell, Actor ignoreActor, bool checkTransientActors) { return true; } public int MovementSpeed { diff --git a/OpenRA.Mods.RA/Air/AttackHeli.cs b/OpenRA.Mods.RA/Air/AttackHeli.cs index b3eac90faa..763ae160e9 100755 --- a/OpenRA.Mods.RA/Air/AttackHeli.cs +++ b/OpenRA.Mods.RA/Air/AttackHeli.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; namespace OpenRA.Mods.RA.Air diff --git a/OpenRA.Mods.RA/Air/AttackPlane.cs b/OpenRA.Mods.RA/Air/AttackPlane.cs index fce0c636af..87588e8daf 100755 --- a/OpenRA.Mods.RA/Air/AttackPlane.cs +++ b/OpenRA.Mods.RA/Air/AttackPlane.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; namespace OpenRA.Mods.RA.Air diff --git a/OpenRA.Mods.RA/Air/Fly.cs b/OpenRA.Mods.RA/Air/Fly.cs index 198ea181d0..059a0fdf98 100755 --- a/OpenRA.Mods.RA/Air/Fly.cs +++ b/OpenRA.Mods.RA/Air/Fly.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Air/FlyCircle.cs b/OpenRA.Mods.RA/Air/FlyCircle.cs index 9302a5e951..8def5c77c9 100644 --- a/OpenRA.Mods.RA/Air/FlyCircle.cs +++ b/OpenRA.Mods.RA/Air/FlyCircle.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Collections.Generic; using OpenRA.Traits; namespace OpenRA.Mods.RA.Air diff --git a/OpenRA.Mods.RA/Air/HeliAttack.cs b/OpenRA.Mods.RA/Air/HeliAttack.cs index 9655601307..2268f6049c 100755 --- a/OpenRA.Mods.RA/Air/HeliAttack.cs +++ b/OpenRA.Mods.RA/Air/HeliAttack.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA.Air diff --git a/OpenRA.Mods.RA/Air/HeliFly.cs b/OpenRA.Mods.RA/Air/HeliFly.cs index f4ac312b23..fba3c0aae0 100755 --- a/OpenRA.Mods.RA/Air/HeliFly.cs +++ b/OpenRA.Mods.RA/Air/HeliFly.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using OpenRA.Traits; @@ -42,7 +41,7 @@ namespace OpenRA.Mods.RA.Air var helicopter = self.Trait(); var cruiseAltitude = new WRange(helicopter.Info.CruiseAltitude * 1024 / Game.CellSize); - if (HeliFly.AdjustAltitude(self, helicopter, cruiseAltitude)) + if (AdjustAltitude(self, helicopter, cruiseAltitude)) return this; // Rotate towards the target diff --git a/OpenRA.Mods.RA/Air/Land.cs b/OpenRA.Mods.RA/Air/Land.cs index 82106ab876..d7a8f3c0b7 100755 --- a/OpenRA.Mods.RA/Air/Land.cs +++ b/OpenRA.Mods.RA/Air/Land.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA.Air diff --git a/OpenRA.Mods.RA/Air/Plane.cs b/OpenRA.Mods.RA/Air/Plane.cs index 4fc91ed44d..741ab020b8 100755 --- a/OpenRA.Mods.RA/Air/Plane.cs +++ b/OpenRA.Mods.RA/Air/Plane.cs @@ -9,7 +9,6 @@ #endregion using System.Drawing; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA.Air diff --git a/OpenRA.Mods.RA/Air/ReturnToBase.cs b/OpenRA.Mods.RA/Air/ReturnToBase.cs index 0d19cb48f5..9cfec5a821 100755 --- a/OpenRA.Mods.RA/Air/ReturnToBase.cs +++ b/OpenRA.Mods.RA/Air/ReturnToBase.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; namespace OpenRA.Mods.RA.Air diff --git a/OpenRA.Mods.RA/Air/TargetableAircraft.cs b/OpenRA.Mods.RA/Air/TargetableAircraft.cs index 0cbeb27e41..daeec60fcc 100755 --- a/OpenRA.Mods.RA/Air/TargetableAircraft.cs +++ b/OpenRA.Mods.RA/Air/TargetableAircraft.cs @@ -8,11 +8,6 @@ */ #endregion -using System.Drawing; -using System.Linq; -using OpenRA.Graphics; -using OpenRA.Traits; - namespace OpenRA.Mods.RA.Air { public class TargetableAircraftInfo : TargetableUnitInfo diff --git a/OpenRA.Mods.RA/Armament.cs b/OpenRA.Mods.RA/Armament.cs index 6a2dcda31a..77e2d82d7f 100644 --- a/OpenRA.Mods.RA/Armament.cs +++ b/OpenRA.Mods.RA/Armament.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; using OpenRA.GameRules; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Attack/AttackBase.cs b/OpenRA.Mods.RA/Attack/AttackBase.cs index 2c18b1c542..decb66c065 100644 --- a/OpenRA.Mods.RA/Attack/AttackBase.cs +++ b/OpenRA.Mods.RA/Attack/AttackBase.cs @@ -97,7 +97,7 @@ namespace OpenRA.Mods.RA { get { - if (Armaments.Count() == 0) + if (!Armaments.Any()) yield break; var negativeDamage = Armaments.First().Weapon.Warheads[0].Damage < 0; diff --git a/OpenRA.Mods.RA/Attack/AttackLeap.cs b/OpenRA.Mods.RA/Attack/AttackLeap.cs index 9bfbed10cf..25db9156df 100644 --- a/OpenRA.Mods.RA/Attack/AttackLeap.cs +++ b/OpenRA.Mods.RA/Attack/AttackLeap.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Mods.RA.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Attack/AttackLoyalty.cs b/OpenRA.Mods.RA/Attack/AttackLoyalty.cs index e7f7d64c83..4c6fa26da6 100644 --- a/OpenRA.Mods.RA/Attack/AttackLoyalty.cs +++ b/OpenRA.Mods.RA/Attack/AttackLoyalty.cs @@ -8,10 +8,8 @@ */ #endregion -using System; using System.Linq; using OpenRA.Traits; -using OpenRA.Mods.RA.Activities; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/Attack/AttackWander.cs b/OpenRA.Mods.RA/Attack/AttackWander.cs index d7614037a2..6b94bb2f8b 100644 --- a/OpenRA.Mods.RA/Attack/AttackWander.cs +++ b/OpenRA.Mods.RA/Attack/AttackWander.cs @@ -9,8 +9,6 @@ #endregion using OpenRA.Traits; -using System.Drawing; -using OpenRA.Mods.RA.Move; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/AttackBomber.cs b/OpenRA.Mods.RA/AttackBomber.cs index 29b020d0da..920a04f1b2 100644 --- a/OpenRA.Mods.RA/AttackBomber.cs +++ b/OpenRA.Mods.RA/AttackBomber.cs @@ -9,10 +9,8 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; -using OpenRA.GameRules; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Bridge.cs b/OpenRA.Mods.RA/Bridge.cs index 26c1bdd34d..6f3f6d9ec7 100644 --- a/OpenRA.Mods.RA/Bridge.cs +++ b/OpenRA.Mods.RA/Bridge.cs @@ -8,14 +8,11 @@ */ #endregion -using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Effects; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.RA.Move; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/BridgeHut.cs b/OpenRA.Mods.RA/BridgeHut.cs index b55590bf6e..c80605a763 100644 --- a/OpenRA.Mods.RA/BridgeHut.cs +++ b/OpenRA.Mods.RA/BridgeHut.cs @@ -8,11 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using OpenRA.FileFormats; -using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Buildings/BaseProvider.cs b/OpenRA.Mods.RA/Buildings/BaseProvider.cs index 8437b70141..9a84a353e1 100755 --- a/OpenRA.Mods.RA/Buildings/BaseProvider.cs +++ b/OpenRA.Mods.RA/Buildings/BaseProvider.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Buildings/FootprintUtils.cs b/OpenRA.Mods.RA/Buildings/FootprintUtils.cs index ddddcef376..92ed5395a4 100755 --- a/OpenRA.Mods.RA/Buildings/FootprintUtils.cs +++ b/OpenRA.Mods.RA/Buildings/FootprintUtils.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenRA.FileFormats; namespace OpenRA.Mods.RA.Buildings { diff --git a/OpenRA.Mods.RA/C4Demolition.cs b/OpenRA.Mods.RA/C4Demolition.cs index 59d876674f..efe655ce03 100644 --- a/OpenRA.Mods.RA/C4Demolition.cs +++ b/OpenRA.Mods.RA/C4Demolition.cs @@ -10,9 +10,7 @@ using System.Collections.Generic; using System.Drawing; -using OpenRA.Effects; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Move; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Captures.cs b/OpenRA.Mods.RA/Captures.cs index ea9f9ac274..337b2ac5b3 100644 --- a/OpenRA.Mods.RA/Captures.cs +++ b/OpenRA.Mods.RA/Captures.cs @@ -8,13 +8,10 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/ChronoshiftDeploy.cs b/OpenRA.Mods.RA/ChronoshiftDeploy.cs index 8f9b768e39..1cf52d50b8 100644 --- a/OpenRA.Mods.RA/ChronoshiftDeploy.cs +++ b/OpenRA.Mods.RA/ChronoshiftDeploy.cs @@ -10,7 +10,6 @@ using System.Drawing; using System.Collections.Generic; -using OpenRA.Effects; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Combat.cs b/OpenRA.Mods.RA/Combat.cs index 206406da41..cc620e9923 100755 --- a/OpenRA.Mods.RA/Combat.cs +++ b/OpenRA.Mods.RA/Combat.cs @@ -13,7 +13,6 @@ using System.Linq; using OpenRA.Effects; using OpenRA.GameRules; using OpenRA.Mods.RA.Effects; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; using System.Collections.Generic; diff --git a/OpenRA.Mods.RA/CombatDebugOverlay.cs b/OpenRA.Mods.RA/CombatDebugOverlay.cs index cae695026b..89c8523580 100755 --- a/OpenRA.Mods.RA/CombatDebugOverlay.cs +++ b/OpenRA.Mods.RA/CombatDebugOverlay.cs @@ -8,14 +8,10 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.FileFormats; -using OpenRA.GameRules; using OpenRA.Graphics; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/ConquestVictoryConditions.cs b/OpenRA.Mods.RA/ConquestVictoryConditions.cs index f37020a031..fa903fdaa7 100644 --- a/OpenRA.Mods.RA/ConquestVictoryConditions.cs +++ b/OpenRA.Mods.RA/ConquestVictoryConditions.cs @@ -44,9 +44,9 @@ namespace OpenRA.Mods.RA var others = self.World.Players.Where( p => !p.NonCombatant && p != self.Owner && p.Stances[self.Owner] != Stance.Ally ); - if (others.Count() == 0) return; + if (!others.Any()) return; - if(others.All(p => p.WinState == WinState.Lost)) + if (others.All(p => p.WinState == WinState.Lost)) Win(self); } diff --git a/OpenRA.Mods.RA/Crates/CloakCrateAction.cs b/OpenRA.Mods.RA/Crates/CloakCrateAction.cs index 4095eda5a0..dcba86a96e 100644 --- a/OpenRA.Mods.RA/Crates/CloakCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/CloakCrateAction.cs @@ -8,10 +8,6 @@ */ #endregion -using OpenRA.FileFormats; -using OpenRA.Mods.RA; -using OpenRA.Traits; - namespace OpenRA.Mods.RA.Crates { public class CloakCrateActionInfo : CrateActionInfo diff --git a/OpenRA.Mods.RA/Crates/GiveMcvCrateAction.cs b/OpenRA.Mods.RA/Crates/GiveMcvCrateAction.cs index 47622bfeac..512a6029bf 100644 --- a/OpenRA.Mods.RA/Crates/GiveMcvCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/GiveMcvCrateAction.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Crates { diff --git a/OpenRA.Mods.RA/Crates/HideMapCrateAction.cs b/OpenRA.Mods.RA/Crates/HideMapCrateAction.cs index 08fae19d0c..4f2f6a7587 100644 --- a/OpenRA.Mods.RA/Crates/HideMapCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/HideMapCrateAction.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Traits; - namespace OpenRA.Mods.RA { class HideMapCrateActionInfo : CrateActionInfo diff --git a/OpenRA.Mods.RA/Crates/RevealMapCrateAction.cs b/OpenRA.Mods.RA/Crates/RevealMapCrateAction.cs index 3e099ffd9f..dd6bfcb5c4 100644 --- a/OpenRA.Mods.RA/Crates/RevealMapCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/RevealMapCrateAction.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs b/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs index 078f2c4331..2b1c91ebfe 100644 --- a/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/SupportPowerCrateAction.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; using OpenRA.FileFormats; diff --git a/OpenRA.Mods.RA/CreateMPPlayers.cs b/OpenRA.Mods.RA/CreateMPPlayers.cs index 4cf069dcb7..02efe48fbc 100644 --- a/OpenRA.Mods.RA/CreateMPPlayers.cs +++ b/OpenRA.Mods.RA/CreateMPPlayers.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using OpenRA.FileFormats; using OpenRA.Network; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/CrushableInfantry.cs b/OpenRA.Mods.RA/CrushableInfantry.cs index c5f9c1f167..43fed1b45e 100644 --- a/OpenRA.Mods.RA/CrushableInfantry.cs +++ b/OpenRA.Mods.RA/CrushableInfantry.cs @@ -8,10 +8,8 @@ */ #endregion -using System.Collections.Generic; using System.Linq; using OpenRA.Traits; -using OpenRA.Mods.RA.Effects; using OpenRA.Mods.RA.Move; using OpenRA.Mods.RA.Render; diff --git a/OpenRA.Mods.RA/DefaultLoadScreen.cs b/OpenRA.Mods.RA/DefaultLoadScreen.cs index a1f1f1e79d..377b6fd912 100644 --- a/OpenRA.Mods.RA/DefaultLoadScreen.cs +++ b/OpenRA.Mods.RA/DefaultLoadScreen.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Network; using OpenRA.Support; using OpenRA.Widgets; diff --git a/OpenRA.Mods.RA/DemoTruck.cs b/OpenRA.Mods.RA/DemoTruck.cs index b0339b01bf..f1050b4d71 100644 --- a/OpenRA.Mods.RA/DemoTruck.cs +++ b/OpenRA.Mods.RA/DemoTruck.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Effects/CashTick.cs b/OpenRA.Mods.RA/Effects/CashTick.cs index 8d924734e7..dd31afc3a0 100644 --- a/OpenRA.Mods.RA/Effects/CashTick.cs +++ b/OpenRA.Mods.RA/Effects/CashTick.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/Corpse.cs b/OpenRA.Mods.RA/Effects/Corpse.cs index 304e50af48..8430f01b70 100644 --- a/OpenRA.Mods.RA/Effects/Corpse.cs +++ b/OpenRA.Mods.RA/Effects/Corpse.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/CrateEffect.cs b/OpenRA.Mods.RA/Effects/CrateEffect.cs index 61bcdfa4e0..9dbf85d4ff 100644 --- a/OpenRA.Mods.RA/Effects/CrateEffect.cs +++ b/OpenRA.Mods.RA/Effects/CrateEffect.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/Explosion.cs b/OpenRA.Mods.RA/Effects/Explosion.cs index 35afe19db5..6cb112563f 100644 --- a/OpenRA.Mods.RA/Effects/Explosion.cs +++ b/OpenRA.Mods.RA/Effects/Explosion.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/GpsSatellite.cs b/OpenRA.Mods.RA/Effects/GpsSatellite.cs index 0cadb1db3b..382c5845ee 100644 --- a/OpenRA.Mods.RA/Effects/GpsSatellite.cs +++ b/OpenRA.Mods.RA/Effects/GpsSatellite.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/GravityBomb.cs b/OpenRA.Mods.RA/Effects/GravityBomb.cs index e021df4a72..1bf03491cc 100644 --- a/OpenRA.Mods.RA/Effects/GravityBomb.cs +++ b/OpenRA.Mods.RA/Effects/GravityBomb.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.GameRules; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/LaserZap.cs b/OpenRA.Mods.RA/Effects/LaserZap.cs index 8092416e2d..791fa1ce1a 100644 --- a/OpenRA.Mods.RA/Effects/LaserZap.cs +++ b/OpenRA.Mods.RA/Effects/LaserZap.cs @@ -14,7 +14,6 @@ using OpenRA.Effects; using OpenRA.FileFormats; using OpenRA.GameRules; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/Missile.cs b/OpenRA.Mods.RA/Effects/Missile.cs index c48b509698..3f4e329340 100755 --- a/OpenRA.Mods.RA/Effects/Missile.cs +++ b/OpenRA.Mods.RA/Effects/Missile.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.Linq; diff --git a/OpenRA.Mods.RA/Effects/Rank.cs b/OpenRA.Mods.RA/Effects/Rank.cs index 654da3a5dc..f263d5e688 100644 --- a/OpenRA.Mods.RA/Effects/Rank.cs +++ b/OpenRA.Mods.RA/Effects/Rank.cs @@ -11,8 +11,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Mods.RA.Buildings; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/SatelliteLaunch.cs b/OpenRA.Mods.RA/Effects/SatelliteLaunch.cs index 8e3e0fecd6..17287e33f8 100644 --- a/OpenRA.Mods.RA/Effects/SatelliteLaunch.cs +++ b/OpenRA.Mods.RA/Effects/SatelliteLaunch.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/Smoke.cs b/OpenRA.Mods.RA/Effects/Smoke.cs index 182a81de12..f781a59ea0 100644 --- a/OpenRA.Mods.RA/Effects/Smoke.cs +++ b/OpenRA.Mods.RA/Effects/Smoke.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/Effects/TeslaZap.cs b/OpenRA.Mods.RA/Effects/TeslaZap.cs index 73ed23e442..de84ba2d45 100644 --- a/OpenRA.Mods.RA/Effects/TeslaZap.cs +++ b/OpenRA.Mods.RA/Effects/TeslaZap.cs @@ -8,13 +8,10 @@ */ #endregion -using System; using System.Collections.Generic; -using System.Linq; using OpenRA.Effects; using OpenRA.GameRules; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { diff --git a/OpenRA.Mods.RA/EmitCargoOnSell.cs b/OpenRA.Mods.RA/EmitCargoOnSell.cs index 79eb0b83a6..85844d112d 100644 --- a/OpenRA.Mods.RA/EmitCargoOnSell.cs +++ b/OpenRA.Mods.RA/EmitCargoOnSell.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Linq; -using OpenRA.FileFormats; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/EngineerRepair.cs b/OpenRA.Mods.RA/EngineerRepair.cs index 86b7bc2154..db0cfd7db5 100644 --- a/OpenRA.Mods.RA/EngineerRepair.cs +++ b/OpenRA.Mods.RA/EngineerRepair.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/ExternalCapturable.cs b/OpenRA.Mods.RA/ExternalCapturable.cs index 7eaf10b59c..08b4d2e72e 100644 --- a/OpenRA.Mods.RA/ExternalCapturable.cs +++ b/OpenRA.Mods.RA/ExternalCapturable.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Linq; -using OpenRA.Effects; using OpenRA.FileFormats; using OpenRA.Traits; using OpenRA.Mods.RA.Buildings; diff --git a/OpenRA.Mods.RA/ExternalCapturableBar.cs b/OpenRA.Mods.RA/ExternalCapturableBar.cs index 04707a0d96..77e62ff1d5 100644 --- a/OpenRA.Mods.RA/ExternalCapturableBar.cs +++ b/OpenRA.Mods.RA/ExternalCapturableBar.cs @@ -9,7 +9,6 @@ #endregion using System.Drawing; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/ExternalCaptures.cs b/OpenRA.Mods.RA/ExternalCaptures.cs index 1aad9fefb2..c8151c90f0 100644 --- a/OpenRA.Mods.RA/ExternalCaptures.cs +++ b/OpenRA.Mods.RA/ExternalCaptures.cs @@ -8,13 +8,10 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/GainsExperience.cs b/OpenRA.Mods.RA/GainsExperience.cs index acfe47709b..c1dd5d3931 100644 --- a/OpenRA.Mods.RA/GainsExperience.cs +++ b/OpenRA.Mods.RA/GainsExperience.cs @@ -8,11 +8,9 @@ */ #endregion -using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; using OpenRA.GameRules; -using OpenRA.Graphics; using OpenRA.Mods.RA.Effects; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/HarvesterHuskModifier.cs b/OpenRA.Mods.RA/HarvesterHuskModifier.cs index 8846aace6e..7454d54c67 100644 --- a/OpenRA.Mods.RA/HarvesterHuskModifier.cs +++ b/OpenRA.Mods.RA/HarvesterHuskModifier.cs @@ -8,9 +8,7 @@ */ #endregion -using OpenRA.FileFormats; using OpenRA.Traits; -using OpenRA.Mods.RA.Move; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/InfiltrateForCash.cs b/OpenRA.Mods.RA/InfiltrateForCash.cs index b0f27fa33c..07315e5a74 100644 --- a/OpenRA.Mods.RA/InfiltrateForCash.cs +++ b/OpenRA.Mods.RA/InfiltrateForCash.cs @@ -9,9 +9,7 @@ #endregion using System; -using System.Linq; using OpenRA.Traits; -using OpenRA.FileFormats; using OpenRA.Mods.RA.Effects; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/InfiltrateForExploration.cs b/OpenRA.Mods.RA/InfiltrateForExploration.cs index e701764085..ef007a59f6 100644 --- a/OpenRA.Mods.RA/InfiltrateForExploration.cs +++ b/OpenRA.Mods.RA/InfiltrateForExploration.cs @@ -8,9 +8,7 @@ */ #endregion -using System.Linq; using OpenRA.Traits; -using OpenRA.FileFormats; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/InfiltrateForSupportPower.cs b/OpenRA.Mods.RA/InfiltrateForSupportPower.cs index 5e133e2b05..9c8793c885 100644 --- a/OpenRA.Mods.RA/InfiltrateForSupportPower.cs +++ b/OpenRA.Mods.RA/InfiltrateForSupportPower.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; using OpenRA.FileFormats; diff --git a/OpenRA.Mods.RA/Infiltrates.cs b/OpenRA.Mods.RA/Infiltrates.cs index 00d6a457ab..7ff8330d77 100644 --- a/OpenRA.Mods.RA/Infiltrates.cs +++ b/OpenRA.Mods.RA/Infiltrates.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.Linq; diff --git a/OpenRA.Mods.RA/JamsMissiles.cs b/OpenRA.Mods.RA/JamsMissiles.cs index 8eb3ad9710..a1c0fde664 100644 --- a/OpenRA.Mods.RA/JamsMissiles.cs +++ b/OpenRA.Mods.RA/JamsMissiles.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Lint/CheckSequences.cs b/OpenRA.Mods.RA/Lint/CheckSequences.cs index b2feb9f9ed..809b6761a8 100644 --- a/OpenRA.Mods.RA/Lint/CheckSequences.cs +++ b/OpenRA.Mods.RA/Lint/CheckSequences.cs @@ -9,12 +9,8 @@ #endregion using System; -using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Reflection; using OpenRA.FileFormats; -using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Lint/LintBuildablePrerequisites.cs b/OpenRA.Mods.RA/Lint/LintBuildablePrerequisites.cs index fd2ac1274e..e899146c81 100644 --- a/OpenRA.Mods.RA/Lint/LintBuildablePrerequisites.cs +++ b/OpenRA.Mods.RA/Lint/LintBuildablePrerequisites.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/MPStartLocations.cs b/OpenRA.Mods.RA/MPStartLocations.cs index c88680f966..b85d0dbfe5 100755 --- a/OpenRA.Mods.RA/MPStartLocations.cs +++ b/OpenRA.Mods.RA/MPStartLocations.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Network; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Mine.cs b/OpenRA.Mods.RA/Mine.cs index aa45da5d14..4e7f24d662 100644 --- a/OpenRA.Mods.RA/Mine.cs +++ b/OpenRA.Mods.RA/Mine.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Linq; -using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Move; using OpenRA.Traits; using OpenRA.FileFormats; diff --git a/OpenRA.Mods.RA/Minelayer.cs b/OpenRA.Mods.RA/Minelayer.cs index ea22afad4e..8f90df31c8 100644 --- a/OpenRA.Mods.RA/Minelayer.cs +++ b/OpenRA.Mods.RA/Minelayer.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.RA.Activities; diff --git a/OpenRA.Mods.RA/Missions/Survival02Script.cs b/OpenRA.Mods.RA/Missions/Survival02Script.cs index 7ee72cef8d..dcace57143 100644 --- a/OpenRA.Mods.RA/Missions/Survival02Script.cs +++ b/OpenRA.Mods.RA/Missions/Survival02Script.cs @@ -19,8 +19,6 @@ using OpenRA.Mods.RA.Move; using OpenRA.Traits; using OpenRA.Widgets; using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Air; -using OpenRA.Scripting; namespace OpenRA.Mods.RA.Missions { diff --git a/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs index 78a7ffa5f9..5c9ba0410b 100644 --- a/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs @@ -9,12 +9,10 @@ #endregion using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Effects; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Move/PathFinder.cs b/OpenRA.Mods.RA/Move/PathFinder.cs index 5b1abc9f26..3ea2d44632 100755 --- a/OpenRA.Mods.RA/Move/PathFinder.cs +++ b/OpenRA.Mods.RA/Move/PathFinder.cs @@ -103,7 +103,7 @@ namespace OpenRA.Mods.RA.Move { var passable = mi.GetMovementClass(world.TileSet); tilesInRange = new List(tilesInRange.Where(t => domainIndex.IsPassable(src, t, (uint)passable))); - if (tilesInRange.Count() == 0) + if (!tilesInRange.Any()) return emptyPath; } diff --git a/OpenRA.Mods.RA/Move/PathSearch.cs b/OpenRA.Mods.RA/Move/PathSearch.cs index efd79d2c7e..9ad2354113 100755 --- a/OpenRA.Mods.RA/Move/PathSearch.cs +++ b/OpenRA.Mods.RA/Move/PathSearch.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Move { diff --git a/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs b/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs index bd28e219af..f9df244ce5 100755 --- a/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs +++ b/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs @@ -10,8 +10,6 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using OpenRA.Traits; namespace OpenRA.Mods.RA.Orders diff --git a/OpenRA.Mods.RA/Orders/EnterAlliedActorTargeter.cs b/OpenRA.Mods.RA/Orders/EnterAlliedActorTargeter.cs index 6d0b77f49e..de33be6931 100755 --- a/OpenRA.Mods.RA/Orders/EnterAlliedActorTargeter.cs +++ b/OpenRA.Mods.RA/Orders/EnterAlliedActorTargeter.cs @@ -9,7 +9,6 @@ #endregion using System; -using System.Collections.Generic; using OpenRA.Traits; namespace OpenRA.Mods.RA.Orders diff --git a/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs b/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs index c21bcf18de..705c5b8e9c 100755 --- a/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs +++ b/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.RA.Buildings; -using OpenRA.Traits; namespace OpenRA.Mods.RA.Orders { @@ -40,7 +39,7 @@ namespace OpenRA.Mods.RA.Orders if (mi.Button == MouseButton.Left) { var underCursor = world.ScreenMap.ActorsAt(mi) - .Where(a => a.Owner == world.LocalPlayer && a.HasTrait()).FirstOrDefault(); + .FirstOrDefault(a => a.Owner == world.LocalPlayer && a.HasTrait()); if (underCursor != null) yield return new Order(order, underCursor, false); diff --git a/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs b/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs index 33f339955c..4813dd6b10 100644 --- a/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs +++ b/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Orders if (mi.Button == MouseButton.Left) { var underCursor = world.ScreenMap.ActorsAt(mi) - .Where(a => !world.FogObscures(a) && a.AppearsFriendlyTo(world.LocalPlayer.PlayerActor) && a.HasTrait()).FirstOrDefault(); + .FirstOrDefault(a => !world.FogObscures(a) && a.AppearsFriendlyTo(world.LocalPlayer.PlayerActor) && a.HasTrait()); if (underCursor == null) yield break; diff --git a/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs b/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs index 3ed8ae752e..659e0dfe84 100755 --- a/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs +++ b/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/PaletteFromCurrentTileset.cs b/OpenRA.Mods.RA/PaletteFromCurrentTileset.cs index 59072acb04..d720da6554 100644 --- a/OpenRA.Mods.RA/PaletteFromCurrentTileset.cs +++ b/OpenRA.Mods.RA/PaletteFromCurrentTileset.cs @@ -9,6 +9,7 @@ #endregion using OpenRA.FileFormats; +using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.RA @@ -36,7 +37,7 @@ namespace OpenRA.Mods.RA this.info = info; } - public void InitPalette(OpenRA.Graphics.WorldRenderer wr) + public void InitPalette(WorldRenderer wr) { wr.AddPalette(info.Name, new Palette(FileSystem.Open(world.TileSet.Palette), info.ShadowIndex), info.AllowModifiers); } diff --git a/OpenRA.Mods.RA/PaletteFromRGBA.cs b/OpenRA.Mods.RA/PaletteFromRGBA.cs index b7ead89448..f3dec16cb9 100644 --- a/OpenRA.Mods.RA/PaletteFromRGBA.cs +++ b/OpenRA.Mods.RA/PaletteFromRGBA.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Drawing; using OpenRA.FileFormats; using OpenRA.Traits; using OpenRA.Graphics; diff --git a/OpenRA.Mods.RA/Player/AllyRepair.cs b/OpenRA.Mods.RA/Player/AllyRepair.cs index 191f754043..b193af2089 100644 --- a/OpenRA.Mods.RA/Player/AllyRepair.cs +++ b/OpenRA.Mods.RA/Player/AllyRepair.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Effects; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs b/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs index 53c2fd6aa8..a186604049 100644 --- a/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs +++ b/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Effects; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs b/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs index f003381ad1..4f790f9df0 100644 --- a/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs +++ b/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Effects; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/PlayerExts.cs b/OpenRA.Mods.RA/PlayerExts.cs index 7f46c26d6c..72c4acde42 100644 --- a/OpenRA.Mods.RA/PlayerExts.cs +++ b/OpenRA.Mods.RA/PlayerExts.cs @@ -8,9 +8,6 @@ */ #endregion -using System; -using OpenRA.Traits; - namespace OpenRA.Mods.RA { public static class PlayerExts diff --git a/OpenRA.Mods.RA/PlayerPaletteFromCurrentTileset.cs b/OpenRA.Mods.RA/PlayerPaletteFromCurrentTileset.cs index 33d62fd07a..cb75d1d6e4 100644 --- a/OpenRA.Mods.RA/PlayerPaletteFromCurrentTileset.cs +++ b/OpenRA.Mods.RA/PlayerPaletteFromCurrentTileset.cs @@ -9,6 +9,7 @@ #endregion using OpenRA.FileFormats; +using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.RA @@ -36,10 +37,10 @@ namespace OpenRA.Mods.RA this.info = info; } - public void InitPalette (OpenRA.Graphics.WorldRenderer wr) + public void InitPalette(WorldRenderer wr) { - string Filename = world.TileSet.PlayerPalette == null ? world.TileSet.Palette : world.TileSet.PlayerPalette; - wr.AddPalette(info.Name, new Palette(FileSystem.Open(Filename), info.ShadowIndex), info.AllowModifiers); + var filename = world.TileSet.PlayerPalette ?? world.TileSet.Palette; + wr.AddPalette(info.Name, new Palette(FileSystem.Open(filename), info.ShadowIndex), info.AllowModifiers); } } } diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index dd9108fb18..bb6264ab30 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -11,8 +11,6 @@ using System.Drawing; using System.Linq; using OpenRA.FileFormats; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Air; using OpenRA.Mods.RA.Move; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Render/RenderBuilding.cs b/OpenRA.Mods.RA/Render/RenderBuilding.cs index 07eadc670e..a1e45b2b74 100755 --- a/OpenRA.Mods.RA/Render/RenderBuilding.cs +++ b/OpenRA.Mods.RA/Render/RenderBuilding.cs @@ -10,11 +10,8 @@ using System; using System.Collections.Generic; -using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Effects; using OpenRA.Traits; using OpenRA.Mods.RA.Activities; diff --git a/OpenRA.Mods.RA/Render/RenderBuildingTurreted.cs b/OpenRA.Mods.RA/Render/RenderBuildingTurreted.cs index c2bc6b420a..20b5f1f490 100644 --- a/OpenRA.Mods.RA/Render/RenderBuildingTurreted.cs +++ b/OpenRA.Mods.RA/Render/RenderBuildingTurreted.cs @@ -10,7 +10,6 @@ using System; using System.Linq; -using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; namespace OpenRA.Mods.RA.Render diff --git a/OpenRA.Mods.RA/Render/RenderBuildingWall.cs b/OpenRA.Mods.RA/Render/RenderBuildingWall.cs index 6b0c4b7638..ee1bdddc20 100644 --- a/OpenRA.Mods.RA/Render/RenderBuildingWall.cs +++ b/OpenRA.Mods.RA/Render/RenderBuildingWall.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; namespace OpenRA.Mods.RA.Render diff --git a/OpenRA.Mods.RA/Render/RenderHarvester.cs b/OpenRA.Mods.RA/Render/RenderHarvester.cs index 705ef6f668..eadc30f0c8 100644 --- a/OpenRA.Mods.RA/Render/RenderHarvester.cs +++ b/OpenRA.Mods.RA/Render/RenderHarvester.cs @@ -8,11 +8,8 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; using OpenRA.Graphics; using OpenRA.Traits; -using OpenRA.Mods.RA.Orders; namespace OpenRA.Mods.RA.Render { diff --git a/OpenRA.Mods.RA/Render/RenderInfantry.cs b/OpenRA.Mods.RA/Render/RenderInfantry.cs index b0e62d8b7a..1098fd8dfc 100644 --- a/OpenRA.Mods.RA/Render/RenderInfantry.cs +++ b/OpenRA.Mods.RA/Render/RenderInfantry.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Effects; using OpenRA.Mods.RA.Move; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Render/RenderSpy.cs b/OpenRA.Mods.RA/Render/RenderSpy.cs index 87be22b060..6fb78c4a5b 100755 --- a/OpenRA.Mods.RA/Render/RenderSpy.cs +++ b/OpenRA.Mods.RA/Render/RenderSpy.cs @@ -8,12 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; -using OpenRA.Graphics; -using OpenRA.Traits; -using OpenRA.Mods.RA.Orders; - namespace OpenRA.Mods.RA.Render { class RenderSpyInfo : RenderInfantryProneInfo @@ -36,7 +30,7 @@ namespace OpenRA.Mods.RA.Render protected override string PaletteName(Actor self) { - var player = spy.disguisedAsPlayer != null ? spy.disguisedAsPlayer : self.Owner; + var player = spy.disguisedAsPlayer ?? self.Owner; return info.Palette ?? info.PlayerPalette + player.InternalName; } @@ -45,10 +39,7 @@ namespace OpenRA.Mods.RA.Render if (spy.disguisedAsSprite != disguisedAsSprite) { disguisedAsSprite = spy.disguisedAsSprite; - if (disguisedAsSprite != null) - anim.ChangeImage(disguisedAsSprite, info.StandAnimations.Random(Game.CosmeticRandom)); - else - anim.ChangeImage(GetImage(self), info.StandAnimations.Random(Game.CosmeticRandom)); + anim.ChangeImage(disguisedAsSprite ?? GetImage(self), info.StandAnimations.Random(Game.CosmeticRandom)); UpdatePalette(); } base.Tick(self); diff --git a/OpenRA.Mods.RA/Render/RenderUnit.cs b/OpenRA.Mods.RA/Render/RenderUnit.cs index 1efdd5c6a2..590e6007dd 100644 --- a/OpenRA.Mods.RA/Render/RenderUnit.cs +++ b/OpenRA.Mods.RA/Render/RenderUnit.cs @@ -9,7 +9,6 @@ #endregion using System; -using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.RA.Render diff --git a/OpenRA.Mods.RA/Render/RenderUnitReload.cs b/OpenRA.Mods.RA/Render/RenderUnitReload.cs index 52cfc561a7..ffc5e63f11 100755 --- a/OpenRA.Mods.RA/Render/RenderUnitReload.cs +++ b/OpenRA.Mods.RA/Render/RenderUnitReload.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Mods.RA.Activities; - namespace OpenRA.Mods.RA.Render { class RenderUnitReloadInfo : RenderUnitInfo diff --git a/OpenRA.Mods.RA/Render/RenderVoxels.cs b/OpenRA.Mods.RA/Render/RenderVoxels.cs index e18e91966a..9333096beb 100755 --- a/OpenRA.Mods.RA/Render/RenderVoxels.cs +++ b/OpenRA.Mods.RA/Render/RenderVoxels.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Collections.Generic; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Render/WithHarvestAnimation.cs b/OpenRA.Mods.RA/Render/WithHarvestAnimation.cs index 7ce6a4a44e..8ccc4df5ae 100644 --- a/OpenRA.Mods.RA/Render/WithHarvestAnimation.cs +++ b/OpenRA.Mods.RA/Render/WithHarvestAnimation.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs b/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs index 571d6421d6..e59b182949 100644 --- a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs +++ b/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs @@ -14,7 +14,6 @@ using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; -using OpenRA.Mods.RA; namespace OpenRA.Mods.RA.Render { diff --git a/OpenRA.Mods.RA/Render/WithResources.cs b/OpenRA.Mods.RA/Render/WithResources.cs index 611a5cc167..26c68c6908 100755 --- a/OpenRA.Mods.RA/Render/WithResources.cs +++ b/OpenRA.Mods.RA/Render/WithResources.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Collections.Generic; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Render/WithTurret.cs b/OpenRA.Mods.RA/Render/WithTurret.cs index fdca26d491..88e647d621 100755 --- a/OpenRA.Mods.RA/Render/WithTurret.cs +++ b/OpenRA.Mods.RA/Render/WithTurret.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; diff --git a/OpenRA.Mods.RA/Render/WithVoxelBarrel.cs b/OpenRA.Mods.RA/Render/WithVoxelBarrel.cs index afb3cd8ac3..5c37823324 100755 --- a/OpenRA.Mods.RA/Render/WithVoxelBarrel.cs +++ b/OpenRA.Mods.RA/Render/WithVoxelBarrel.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; diff --git a/OpenRA.Mods.RA/Render/WithVoxelBody.cs b/OpenRA.Mods.RA/Render/WithVoxelBody.cs index 175ac1ed4c..7db92c7482 100755 --- a/OpenRA.Mods.RA/Render/WithVoxelBody.cs +++ b/OpenRA.Mods.RA/Render/WithVoxelBody.cs @@ -9,9 +9,7 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Render/WithVoxelTurret.cs b/OpenRA.Mods.RA/Render/WithVoxelTurret.cs index 29f47c8fe2..04b8393441 100755 --- a/OpenRA.Mods.RA/Render/WithVoxelTurret.cs +++ b/OpenRA.Mods.RA/Render/WithVoxelTurret.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Collections.Generic; using System.Linq; using OpenRA.FileFormats; diff --git a/OpenRA.Mods.RA/Render/WithVoxelWalkerBody.cs b/OpenRA.Mods.RA/Render/WithVoxelWalkerBody.cs index 4a2181f676..4b6fbfe5b7 100755 --- a/OpenRA.Mods.RA/Render/WithVoxelWalkerBody.cs +++ b/OpenRA.Mods.RA/Render/WithVoxelWalkerBody.cs @@ -9,9 +9,7 @@ #endregion using System; -using System.Collections.Generic; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Mods.RA.Move; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/RepairsBridges.cs b/OpenRA.Mods.RA/RepairsBridges.cs index b95ba0f8ad..bc1bdcbd47 100644 --- a/OpenRA.Mods.RA/RepairsBridges.cs +++ b/OpenRA.Mods.RA/RepairsBridges.cs @@ -11,7 +11,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Scripting/RASpecialPowers.cs b/OpenRA.Mods.RA/Scripting/RASpecialPowers.cs index 021ddc8e85..304e7f8176 100644 --- a/OpenRA.Mods.RA/Scripting/RASpecialPowers.cs +++ b/OpenRA.Mods.RA/Scripting/RASpecialPowers.cs @@ -9,10 +9,8 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Render; namespace OpenRA.Scripting { diff --git a/OpenRA.Mods.RA/ServerTraits/PlayerPinger.cs b/OpenRA.Mods.RA/ServerTraits/PlayerPinger.cs index 0b32107b8d..ee9d24cd70 100644 --- a/OpenRA.Mods.RA/ServerTraits/PlayerPinger.cs +++ b/OpenRA.Mods.RA/ServerTraits/PlayerPinger.cs @@ -9,11 +9,7 @@ #endregion using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; using OpenRA.Server; -using OpenRA.Network; using S = OpenRA.Server.Server; namespace OpenRA.Mods.RA.Server diff --git a/OpenRA.Mods.RA/Spy.cs b/OpenRA.Mods.RA/Spy.cs index d0d0459d28..939ae66805 100644 --- a/OpenRA.Mods.RA/Spy.cs +++ b/OpenRA.Mods.RA/Spy.cs @@ -11,9 +11,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Orders; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/SupplyTruck.cs b/OpenRA.Mods.RA/SupplyTruck.cs index 1ff07ba7b2..fec31710e7 100644 --- a/OpenRA.Mods.RA/SupplyTruck.cs +++ b/OpenRA.Mods.RA/SupplyTruck.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.FileFormats; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Buildings; using OpenRA.Mods.RA.Orders; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs index 9b3811c586..23f3195317 100644 --- a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs @@ -12,9 +12,6 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.RA.Render; -using OpenRA.Traits; -using OpenRA.Mods.RA.Effects; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/SupportPowers/GpsPower.cs b/OpenRA.Mods.RA/SupportPowers/GpsPower.cs index c3554b9d5e..6f03183fdd 100755 --- a/OpenRA.Mods.RA/SupportPowers/GpsPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/GpsPower.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using System.Drawing; using System.Collections.Generic; using OpenRA.Effects; using OpenRA.Mods.RA.Effects; diff --git a/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs b/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs index a483fe30c9..31cdf45257 100644 --- a/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.RA.Effects; using OpenRA.Mods.RA.Render; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/SupportPowers/NukePower.cs b/OpenRA.Mods.RA/SupportPowers/NukePower.cs index 230f303909..715e0d0835 100755 --- a/OpenRA.Mods.RA/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/NukePower.cs @@ -9,7 +9,6 @@ #endregion using OpenRA.Mods.RA.Effects; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs b/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs index 142b7ac81c..3c65745a2a 100755 --- a/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs @@ -8,8 +8,6 @@ */ #endregion -using OpenRA.Traits; - namespace OpenRA.Mods.RA { public class SonarPulsePowerInfo : SupportPowerInfo diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPower.cs b/OpenRA.Mods.RA/SupportPowers/SupportPower.cs index 158987c405..3695eb44fc 100755 --- a/OpenRA.Mods.RA/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPower.cs @@ -8,8 +8,6 @@ */ #endregion -using System.Linq; -using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/TargetableSubmarine.cs b/OpenRA.Mods.RA/TargetableSubmarine.cs index 20b34adc50..96885cdbd0 100644 --- a/OpenRA.Mods.RA/TargetableSubmarine.cs +++ b/OpenRA.Mods.RA/TargetableSubmarine.cs @@ -8,7 +8,6 @@ */ #endregion -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/TargetableUnit.cs b/OpenRA.Mods.RA/TargetableUnit.cs index 34d3d3ab20..80b3bde925 100755 --- a/OpenRA.Mods.RA/TargetableUnit.cs +++ b/OpenRA.Mods.RA/TargetableUnit.cs @@ -9,7 +9,6 @@ #endregion using System.Collections.Generic; -using System.Linq; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/TeslaZapRenderable.cs b/OpenRA.Mods.RA/TeslaZapRenderable.cs index 2293dcf29a..6528d4aef6 100755 --- a/OpenRA.Mods.RA/TeslaZapRenderable.cs +++ b/OpenRA.Mods.RA/TeslaZapRenderable.cs @@ -11,10 +11,7 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenRA.Effects; -using OpenRA.GameRules; using OpenRA.Graphics; -using OpenRA.Traits; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/ThrowsParticle.cs b/OpenRA.Mods.RA/ThrowsParticle.cs index 0bf3b1a36e..e2cfac4ec0 100644 --- a/OpenRA.Mods.RA/ThrowsParticle.cs +++ b/OpenRA.Mods.RA/ThrowsParticle.cs @@ -10,7 +10,6 @@ using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.RA.Render; using OpenRA.Traits; namespace OpenRA.Mods.RA diff --git a/OpenRA.Mods.RA/TransformOnPassenger.cs b/OpenRA.Mods.RA/TransformOnPassenger.cs index 6a899d0c27..ecb5b3ad7f 100644 --- a/OpenRA.Mods.RA/TransformOnPassenger.cs +++ b/OpenRA.Mods.RA/TransformOnPassenger.cs @@ -9,7 +9,6 @@ #endregion using System.Linq; -using OpenRA.FileFormats; using OpenRA.Mods.RA.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Turreted.cs b/OpenRA.Mods.RA/Turreted.cs index bbd303ae23..cb6b5b069e 100755 --- a/OpenRA.Mods.RA/Turreted.cs +++ b/OpenRA.Mods.RA/Turreted.cs @@ -8,10 +8,6 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Linq; -using OpenRA.Mods.RA.Render; using OpenRA.FileFormats; using OpenRA.Traits; @@ -101,7 +97,7 @@ namespace OpenRA.Mods.RA // Quantize orientation to match a rendered sprite // Implies no pitch or yaw - var facing = Traits.Util.QuantizeFacing(local.Yaw.Angle / 4, QuantizedFacings) * (256 / QuantizedFacings); + var facing = Util.QuantizeFacing(local.Yaw.Angle / 4, QuantizedFacings) * (256 / QuantizedFacings); return new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing)); } } diff --git a/OpenRA.Mods.RA/VoxelNormalsPalette.cs b/OpenRA.Mods.RA/VoxelNormalsPalette.cs index 4584b844f9..ea102f67ab 100644 --- a/OpenRA.Mods.RA/VoxelNormalsPalette.cs +++ b/OpenRA.Mods.RA/VoxelNormalsPalette.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using OpenRA.FileFormats; using OpenRA.Traits; using OpenRA.Graphics; diff --git a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs index 1d9b018707..db0fe250f4 100755 --- a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs +++ b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs @@ -290,7 +290,7 @@ namespace OpenRA.Mods.RA.Widgets new float2(Game.Renderer.Resolution.Width - 14, origin.Y - 23)); for (int i = 0; i < numActualRows; i++) - WidgetUtils.DrawRGBA(ChromeProvider.GetImage(paletteCollection, "dock-" + (i % 4).ToString()), + WidgetUtils.DrawRGBA(ChromeProvider.GetImage(paletteCollection, "dock-" + (i % 4)), new float2(Game.Renderer.Resolution.Width - 14, origin.Y + IconHeight * i)); WidgetUtils.DrawRGBA(ChromeProvider.GetImage(paletteCollection, "dock-bottom"), diff --git a/OpenRA.Mods.RA/Widgets/ColorMixerWidget.cs b/OpenRA.Mods.RA/Widgets/ColorMixerWidget.cs index fe42bd1399..41d55df39a 100755 --- a/OpenRA.Mods.RA/Widgets/ColorMixerWidget.cs +++ b/OpenRA.Mods.RA/Widgets/ColorMixerWidget.cs @@ -10,8 +10,6 @@ using System; using System.Drawing; -using System.Drawing.Imaging; -using System.Linq; using System.Threading; using OpenRA.FileFormats; using OpenRA.Graphics; @@ -35,7 +33,7 @@ namespace OpenRA.Mods.RA.Widgets Thread workerThread; bool workerAlive; - public ColorMixerWidget() : base() {} + public ColorMixerWidget() {} public ColorMixerWidget(ColorMixerWidget other) : base(other) { diff --git a/OpenRA.Mods.RA/Widgets/ColorPreviewManagerWidget.cs b/OpenRA.Mods.RA/Widgets/ColorPreviewManagerWidget.cs index d1c26ddd1e..cdcdfd3f74 100755 --- a/OpenRA.Mods.RA/Widgets/ColorPreviewManagerWidget.cs +++ b/OpenRA.Mods.RA/Widgets/ColorPreviewManagerWidget.cs @@ -9,11 +9,8 @@ #endregion -using System; -using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets @@ -31,7 +28,6 @@ namespace OpenRA.Mods.RA.Widgets [ObjectCreator.UseCtor] public ColorPreviewManagerWidget(WorldRenderer worldRenderer) - : base() { this.worldRenderer = worldRenderer; } diff --git a/OpenRA.Mods.RA/Widgets/HueSliderWidget.cs b/OpenRA.Mods.RA/Widgets/HueSliderWidget.cs index 18b7b878d6..7d0fdfd9bc 100755 --- a/OpenRA.Mods.RA/Widgets/HueSliderWidget.cs +++ b/OpenRA.Mods.RA/Widgets/HueSliderWidget.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using System.Drawing.Imaging; using OpenRA.FileFormats; @@ -22,7 +21,7 @@ namespace OpenRA.Mods.RA.Widgets Bitmap hueBitmap; Sprite hueSprite; - public HueSliderWidget() : base() {} + public HueSliderWidget() {} public HueSliderWidget(HueSliderWidget other) : base(other) {} public override void Initialize(WidgetArgs args) diff --git a/OpenRA.Mods.RA/Widgets/Logic/AssetBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/AssetBrowserLogic.cs index d55e524501..a0a7470ccb 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/AssetBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/AssetBrowserLogic.cs @@ -13,8 +13,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using OpenRA.FileFormats; -using OpenRA.GameRules; -using OpenRA.Graphics; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets.Logic diff --git a/OpenRA.Mods.RA/Widgets/Logic/CheatsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/CheatsLogic.cs index 890f3dc677..87675980ea 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/CheatsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/CheatsLogic.cs @@ -9,11 +9,6 @@ #endregion using System; -using System.Drawing; -using System.Reflection; -using System.Linq; -using OpenRA; -using OpenRA.Graphics; using OpenRA.Traits; using OpenRA.Widgets; using XRandom = OpenRA.Thirdparty.Random; diff --git a/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs index 5a9b9cc8be..1805c23fa0 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs @@ -9,8 +9,6 @@ #endregion using System; -using System.Drawing; -using System.Linq; using OpenRA.Network; using OpenRA.Widgets; diff --git a/OpenRA.Mods.RA/Widgets/Logic/ConvertGameFilesLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ConvertGameFilesLogic.cs index 8c1f537a9d..8cd8bfcc60 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ConvertGameFilesLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ConvertGameFilesLogic.cs @@ -12,11 +12,8 @@ using System; using System.IO; using System.Linq; using System.Threading; -using System.Diagnostics; -using OpenRA.FileFormats; -using OpenRA.FileFormats.Graphics; -using OpenRA.Widgets; using OpenRA.Utility; +using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets.Logic { @@ -73,21 +70,21 @@ namespace OpenRA.Mods.RA.Widgets.Logic { progressBar.Percentage = i*100/ExtractGameFiles.Count(); statusLabel.GetText = () => "Extracting..."; - Utility.Command.ExtractFiles(ExtractGameFiles[i]); + Command.ExtractFiles(ExtractGameFiles[i]); } for (int i = 0; i < ExportToPng.Length; i++) { progressBar.Percentage = i*100/ExportToPng.Count(); statusLabel.GetText = () => "Exporting SHP to PNG..."; - Utility.Command.ConvertShpToPng(ExportToPng[i]); + Command.ConvertShpToPng(ExportToPng[i]); } for (int i = 0; i < ImportFromPng.Length; i++) { progressBar.Percentage = i*100/ImportFromPng.Count(); statusLabel.GetText = () => "Converting PNG to SHP..."; - Utility.Command.ConvertPngToShp(ImportFromPng[i]); + Command.ConvertPngToShp(ImportFromPng[i]); } Game.RunAfterTick(() => diff --git a/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs index 8cde095269..b377f38287 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs @@ -9,8 +9,6 @@ #endregion using System; -using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.Traits; using OpenRA.Network; diff --git a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs index bab69261d4..3a0d3c541f 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/IngameChatLogic.cs @@ -8,7 +8,6 @@ */ #endregion -using System; using System.Drawing; using System.Linq; using OpenRA.Network; diff --git a/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs index c78c0b53ac..96efb7ea5c 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs @@ -10,7 +10,6 @@ using System.Drawing; using System.Linq; -using OpenRA.Network; using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; using OpenRA.Widgets; diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs index 0458b1a338..a7f0597644 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs @@ -184,7 +184,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { var options = new Dictionary>(); - var botController = orderManager.LobbyInfo.Clients.Where(c => c.IsAdmin).FirstOrDefault(); + var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin); if (orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots)) { var botOptions = new List(){ new DropDownOption() @@ -319,7 +319,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic fragileAlliance.IsDisabled = () => Map.Options.FragileAlliances.HasValue || configurationDisabled(); fragileAlliance.OnClick = () => orderManager.IssueOrder(Order.Command( "fragilealliance {0}".F(!orderManager.LobbyInfo.GlobalSettings.FragileAlliances))); - }; + } var difficulty = optionsBin.GetOrNull("DIFFICULTY_DROPDOWNBUTTON"); if (difficulty != null) @@ -417,7 +417,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic enableShroud.IsDisabled = () => Map.Options.Shroud.HasValue || configurationDisabled(); enableShroud.OnClick = () => orderManager.IssueOrder(Order.Command( "shroud {0}".F(!orderManager.LobbyInfo.GlobalSettings.Shroud))); - }; + } var enableFog = optionsBin.GetOrNull("FOG_CHECKBOX"); if (enableFog != null) @@ -426,7 +426,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic enableFog.IsDisabled = () => Map.Options.Fog.HasValue || configurationDisabled(); enableFog.OnClick = () => orderManager.IssueOrder(Order.Command( "fog {0}".F(!orderManager.LobbyInfo.GlobalSettings.Fog))); - }; + } var disconnectButton = lobby.Get("DISCONNECT_BUTTON"); disconnectButton.OnClick = () => { CloseWindow(); onExit(); }; @@ -467,7 +467,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { var slot = orderManager.LobbyInfo.FirstEmptySlot(); var bot = Rules.Info["player"].Traits.WithInterface().Select(t => t.Name).FirstOrDefault(); - var botController = orderManager.LobbyInfo.Clients.Where(c => c.IsAdmin).FirstOrDefault(); + var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin); if (slot != null && bot != null) orderManager.IssueOrder(Order.Command("slot_bot {0} {1} {2}".F(slot, botController.Index, bot))); }); diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs index 1c656ba881..6b58d45abc 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs @@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic foreach (var b in Rules.Info["player"].Traits.WithInterface().Select(t => t.Name)) { var bot = b; - var botController = orderManager.LobbyInfo.Clients.Where(c => c.IsAdmin).FirstOrDefault(); + var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin); bots.Add(new SlotDropDownOption(bot, "slot_bot {0} {1} {2}".F(slot.PlayerReference, botController.Index, bot), () => client != null && client.Bot == bot)); @@ -254,7 +254,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic slot.IsVisible = () => true; slot.IsDisabled = () => orderManager.LocalClient.IsReady; slot.GetText = () => c != null ? c.Name : s.Closed ? "Closed" : "Open"; - slot.OnMouseDown = _ => LobbyUtils.ShowSlotDropDown(slot, s, c, orderManager); + slot.OnMouseDown = _ => ShowSlotDropDown(slot, s, c, orderManager); // Ensure Name selector (if present) is hidden var name = parent.GetOrNull("NAME"); @@ -297,7 +297,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { var color = parent.Get("COLOR"); color.IsDisabled = () => (s != null && s.LockColor) || orderManager.LocalClient.IsReady; - color.OnMouseDown = _ => LobbyUtils.ShowColorDropDown(color, c, orderManager, colorPreview); + color.OnMouseDown = _ => ShowColorDropDown(color, c, orderManager, colorPreview); SetupColorWidget(color, s, c); } @@ -312,7 +312,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { var dropdown = parent.Get("FACTION"); dropdown.IsDisabled = () => s.LockRace || orderManager.LocalClient.IsReady; - dropdown.OnMouseDown = _ => LobbyUtils.ShowRaceDropDown(dropdown, c, orderManager, countryNames); + dropdown.OnMouseDown = _ => ShowRaceDropDown(dropdown, c, orderManager, countryNames); SetupFactionWidget(dropdown, s, c, countryNames); } @@ -329,7 +329,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { var dropdown = parent.Get("TEAM"); dropdown.IsDisabled = () => s.LockTeam || orderManager.LocalClient.IsReady; - dropdown.OnMouseDown = _ => LobbyUtils.ShowTeamDropDown(dropdown, c, orderManager, teamCount); + dropdown.OnMouseDown = _ => ShowTeamDropDown(dropdown, c, orderManager, teamCount); dropdown.GetText = () => (c.Team == 0) ? "-" : c.Team.ToString(); } diff --git a/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs index 1a74fc5d17..44628aa683 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading; using OpenRA.FileFormats; using OpenRA.Widgets; diff --git a/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs index 56b1af0cf1..217d93b9ff 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs @@ -9,9 +9,7 @@ #endregion using System; -using System.IO; using System.Linq; -using OpenRA.FileFormats; using OpenRA.GameRules; using OpenRA.Traits; using OpenRA.Widgets; diff --git a/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs index aec095c18e..b623de83e6 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs @@ -9,12 +9,7 @@ #endregion using System; -using System.Collections.Generic; -using System.Drawing; using System.Linq; -using OpenRA.Mods.RA.Buildings; -using OpenRA.Mods.RA.Orders; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets.Logic diff --git a/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs index 5e10fe1483..90733e0b57 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Mods.RA.Buildings; using OpenRA.Network; diff --git a/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs index 016bd4a27d..d885fcb68d 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs @@ -8,7 +8,6 @@ */ #endregion -using OpenRA; using OpenRA.Mods.RA.Orders; using OpenRA.Widgets; diff --git a/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs index ff02f8d221..71e27488c0 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs @@ -13,7 +13,6 @@ using System.IO; using System.Linq; using System.Threading; using OpenRA.FileFormats; -using OpenRA.FileFormats.Graphics; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets.Logic diff --git a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs index 4eb90c85f9..9adb9855ee 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs @@ -194,7 +194,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic return; } - if (games.Count() == 0) + if (!games.Any()) { searchStatus = SearchStatus.NoGames; return; diff --git a/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs index bc96b5ae55..94839ef76a 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs @@ -16,8 +16,6 @@ using OpenRA.FileFormats; using OpenRA.FileFormats.Graphics; using OpenRA.GameRules; using OpenRA.Graphics; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Widgets; using OpenRA.Widgets; namespace OpenRA.Mods.Ra.Widgets.Logic diff --git a/OpenRA.Mods.RA/Widgets/Logic/SpawnSelectorTooltipLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/SpawnSelectorTooltipLogic.cs index 3745ae98e4..77cede929f 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/SpawnSelectorTooltipLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/SpawnSelectorTooltipLogic.cs @@ -9,10 +9,8 @@ #endregion using System; -using System.Drawing; using System.Linq; using OpenRA.Widgets; -using OpenRA.Network; namespace OpenRA.Mods.RA.Widgets.Logic { diff --git a/OpenRA.Mods.RA/Widgets/ObserverProductionIconsWidget.cs b/OpenRA.Mods.RA/Widgets/ObserverProductionIconsWidget.cs index 5526ad357d..af7ff43802 100644 --- a/OpenRA.Mods.RA/Widgets/ObserverProductionIconsWidget.cs +++ b/OpenRA.Mods.RA/Widgets/ObserverProductionIconsWidget.cs @@ -27,7 +27,6 @@ namespace OpenRA.Mods.RA.Widgets [ObjectCreator.UseCtor] public ObserverProductionIconsWidget(World world, WorldRenderer worldRenderer) - : base() { this.world = world; this.worldRenderer = worldRenderer; @@ -66,7 +65,7 @@ namespace OpenRA.Mods.RA.Widgets if (current == null) continue; - var actor = queue.Trait.AllItems().Where(a => a.Name == current.Item).FirstOrDefault(); + var actor = queue.Trait.AllItems().FirstOrDefault(a => a.Name == current.Item); if (actor == null) continue; diff --git a/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs b/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs index ea2b607338..e192e162c1 100644 --- a/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs +++ b/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs @@ -27,7 +27,6 @@ namespace OpenRA.Mods.RA.Widgets [ObjectCreator.UseCtor] public ObserverSupportPowerIconsWidget(World world, WorldRenderer worldRenderer) - : base() { this.world = world; diff --git a/OpenRA.Mods.RA/Widgets/RadarWidget.cs b/OpenRA.Mods.RA/Widgets/RadarWidget.cs index eb3c518e11..f5c18abd30 100755 --- a/OpenRA.Mods.RA/Widgets/RadarWidget.cs +++ b/OpenRA.Mods.RA/Widgets/RadarWidget.cs @@ -10,7 +10,6 @@ using System; using System.Drawing; -using System.Linq; using OpenRA.Graphics; using OpenRA.Widgets; diff --git a/OpenRA.Mods.RA/Widgets/ResourceBarWidget.cs b/OpenRA.Mods.RA/Widgets/ResourceBarWidget.cs index 32d0c28d5a..ff51d1615d 100755 --- a/OpenRA.Mods.RA/Widgets/ResourceBarWidget.cs +++ b/OpenRA.Mods.RA/Widgets/ResourceBarWidget.cs @@ -12,7 +12,6 @@ using System; using System.Drawing; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets diff --git a/OpenRA.Mods.RA/Widgets/SlidingContainerWidget.cs b/OpenRA.Mods.RA/Widgets/SlidingContainerWidget.cs index 134a91014a..2344dd8ee7 100755 --- a/OpenRA.Mods.RA/Widgets/SlidingContainerWidget.cs +++ b/OpenRA.Mods.RA/Widgets/SlidingContainerWidget.cs @@ -10,9 +10,6 @@ using System; using System.Drawing; -using System.Linq; -using OpenRA.Graphics; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets @@ -29,7 +26,6 @@ namespace OpenRA.Mods.RA.Widgets int2 offset; int frame; - public SlidingContainerWidget() : base() { } public override void Initialize(WidgetArgs args) { base.Initialize(args); diff --git a/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs b/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs index 2f17bff93d..f5155d5780 100644 --- a/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs +++ b/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs @@ -8,11 +8,9 @@ */ #endregion -using System; using System.Drawing; using System.Linq; using OpenRA.Graphics; -using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets diff --git a/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs b/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs index 40ec8febb0..27a4f32dbb 100755 --- a/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs +++ b/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs @@ -126,7 +126,7 @@ namespace OpenRA.Mods.RA.Widgets if (sp.TotalTime > 0) { pos += new int2(0,20); - Game.Renderer.Fonts["Bold"].DrawText(WidgetUtils.FormatTime(sp.RemainingTime).ToString(), pos, Color.White); + Game.Renderer.Fonts["Bold"].DrawText(WidgetUtils.FormatTime(sp.RemainingTime), pos, Color.White); Game.Renderer.Fonts["Bold"].DrawText("/ {0}".F(WidgetUtils.FormatTime(sp.TotalTime)), pos + new int2(45,0), Color.White); } diff --git a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs index 8243c153f1..ff199ab99e 100644 --- a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs +++ b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs @@ -13,8 +13,6 @@ using System.Drawing; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; -using OpenRA.Mods.RA.Orders; -using OpenRA.Network; using OpenRA.Orders; using OpenRA.Widgets; @@ -138,8 +136,7 @@ namespace OpenRA.Mods.RA.Widgets var actor = world.Selection.Actors .Where(a => a.Owner == world.LocalPlayer && !a.Destroyed) .Select(a => Pair.New(a, a.TraitOrDefault())) - .Where(a => a.Second != null) - .FirstOrDefault(); + .FirstOrDefault(a => a.Second != null); if (actor.First == null) return true; diff --git a/OpenRA.Mods.RA/World/DomainIndex.cs b/OpenRA.Mods.RA/World/DomainIndex.cs index d5490afd15..dae2a6ca05 100644 --- a/OpenRA.Mods.RA/World/DomainIndex.cs +++ b/OpenRA.Mods.RA/World/DomainIndex.cs @@ -8,12 +8,9 @@ */ #endregion -using System; using System.Collections.Generic; using System.Drawing; using System.Linq; - -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Mods.RA.Move; using OpenRA.Support; @@ -150,8 +147,7 @@ namespace OpenRA.Mods.RA var toProcess = new Stack(); toProcess.Push(d1); - var i = 0; - while (toProcess.Count() > 0) + while (toProcess.Any()) { var current = toProcess.Pop(); if (!transientConnections.ContainsKey(current)) @@ -166,7 +162,6 @@ namespace OpenRA.Mods.RA } visited.Add(current); - i += 1; } return false; diff --git a/OpenRA.Mods.RA/World/PathfinderDebugOverlay.cs b/OpenRA.Mods.RA/World/PathfinderDebugOverlay.cs index 7917c00cea..7a4ba1f35b 100644 --- a/OpenRA.Mods.RA/World/PathfinderDebugOverlay.cs +++ b/OpenRA.Mods.RA/World/PathfinderDebugOverlay.cs @@ -11,15 +11,13 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Text; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; namespace OpenRA.Mods.RA { - class PathfinderDebugOverlayInfo : Traits.TraitInfo { } + class PathfinderDebugOverlayInfo : TraitInfo { } class PathfinderDebugOverlay : IRenderOverlay, IWorldLoaded { Dictionary layers; diff --git a/OpenRA.Mods.RA/World/PlayMusicOnMapLoad.cs b/OpenRA.Mods.RA/World/PlayMusicOnMapLoad.cs index fe60262301..cdc8e77614 100644 --- a/OpenRA.Mods.RA/World/PlayMusicOnMapLoad.cs +++ b/OpenRA.Mods.RA/World/PlayMusicOnMapLoad.cs @@ -9,11 +9,8 @@ #endregion using System; -using System.Collections.Generic; -using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Traits; -using OpenRA.Widgets; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/World/ResourceClaim.cs b/OpenRA.Mods.RA/World/ResourceClaim.cs index 42a8cccf81..4679ec5c0a 100644 --- a/OpenRA.Mods.RA/World/ResourceClaim.cs +++ b/OpenRA.Mods.RA/World/ResourceClaim.cs @@ -1,7 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +#region Copyright & License Information +/* + * Copyright 2007-2013 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/World/ResourceClaimLayer.cs b/OpenRA.Mods.RA/World/ResourceClaimLayer.cs index 80e1aaf7dd..1f94d71676 100644 --- a/OpenRA.Mods.RA/World/ResourceClaimLayer.cs +++ b/OpenRA.Mods.RA/World/ResourceClaimLayer.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using OpenRA.Graphics; using OpenRA.Traits; @@ -35,7 +32,7 @@ namespace OpenRA.Mods.RA } } - public void WorldLoaded(OpenRA.World w, WorldRenderer wr) + public void WorldLoaded(World w, WorldRenderer wr) { // NOTE(jsd): 32 seems a sane default initial capacity for the total # of harvesters in a game. Purely a guesstimate. claimByCell = new Dictionary(32); diff --git a/OpenRA.Mods.RA/World/SmudgeLayer.cs b/OpenRA.Mods.RA/World/SmudgeLayer.cs index 0c33aafe2a..2569cfa377 100644 --- a/OpenRA.Mods.RA/World/SmudgeLayer.cs +++ b/OpenRA.Mods.RA/World/SmudgeLayer.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; diff --git a/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs b/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs index aaa96f4a79..4bff21fb75 100755 --- a/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs +++ b/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs @@ -12,8 +12,7 @@ using System; using System.IO; using System.Linq; using System.Threading; -using OpenRA.FileFormats; -using OpenRA.FileFormats.Graphics; +using OpenRA.FileFormats; using OpenRA.Widgets; namespace OpenRA.Mods.TS.Widgets.Logic diff --git a/OpenRA.Renderer.Cg/GraphicsDevice.cs b/OpenRA.Renderer.Cg/GraphicsDevice.cs index 7da81d7b5e..15c8d69e46 100755 --- a/OpenRA.Renderer.Cg/GraphicsDevice.cs +++ b/OpenRA.Renderer.Cg/GraphicsDevice.cs @@ -55,8 +55,8 @@ namespace OpenRA.Renderer.Cg Tao.Cg.Cg.cgSetErrorCallback(errorCallback); - Tao.Cg.CgGl.cgGLRegisterStates(Context); - Tao.Cg.CgGl.cgGLSetManageTextureParameters(Context, true); + CgGl.cgGLRegisterStates(Context); + CgGl.cgGLSetManageTextureParameters(Context, true); VertexProfile = CgGl.cgGLGetLatestProfile(CgGl.CG_GL_VERTEX); FragmentProfile = CgGl.cgGLGetLatestProfile(CgGl.CG_GL_FRAGMENT); } diff --git a/OpenRA.Renderer.Null/NullGraphicsDevice.cs b/OpenRA.Renderer.Null/NullGraphicsDevice.cs index b8821266e1..45d18fba2d 100644 --- a/OpenRA.Renderer.Null/NullGraphicsDevice.cs +++ b/OpenRA.Renderer.Null/NullGraphicsDevice.cs @@ -11,7 +11,6 @@ using System; using System.Drawing; using OpenRA.FileFormats.Graphics; -using OpenRA.Graphics; [assembly: Renderer(typeof(OpenRA.Renderer.Null.DeviceFactory))] diff --git a/OpenRA.Renderer.Sdl2/Sdl2Input.cs b/OpenRA.Renderer.Sdl2/Sdl2Input.cs index 686b21ccc9..37c021a524 100644 --- a/OpenRA.Renderer.Sdl2/Sdl2Input.cs +++ b/OpenRA.Renderer.Sdl2/Sdl2Input.cs @@ -8,8 +8,6 @@ */ #endregion -using System; -using System.IO; using System.Text; using OpenRA.Renderer.SdlCommon; using SDL2; @@ -49,7 +47,7 @@ namespace OpenRA.Renderer.Sdl2 switch (e.type) { case SDL.SDL_EventType.SDL_QUIT: - OpenRA.Game.Exit(); + Game.Exit(); break; case SDL.SDL_EventType.SDL_WINDOWEVENT: @@ -178,7 +176,7 @@ namespace OpenRA.Renderer.Sdl2 if (e.key.keysym.sym == SDL.SDL_Keycode.SDLK_F4 && mods.HasModifier(Modifiers.Alt) && Platform.CurrentPlatform == PlatformType.Windows) { - OpenRA.Game.Exit(); + Game.Exit(); } else inputHandler.OnKeyInput(keyEvent); diff --git a/OpenRA.Renderer.SdlCommon/FrameBuffer.cs b/OpenRA.Renderer.SdlCommon/FrameBuffer.cs index 4d312bcc3c..936b5a164b 100644 --- a/OpenRA.Renderer.SdlCommon/FrameBuffer.cs +++ b/OpenRA.Renderer.SdlCommon/FrameBuffer.cs @@ -11,9 +11,7 @@ using System; using System.Diagnostics; using System.Drawing; -using System.Drawing.Imaging; using System.IO; -using OpenRA.FileFormats; using OpenRA.FileFormats.Graphics; using Tao.OpenGl; diff --git a/OpenRA.Renderer.SdlCommon/SdlInput.cs b/OpenRA.Renderer.SdlCommon/SdlInput.cs index 3da9fb3d5b..6305e0fb74 100644 --- a/OpenRA.Renderer.SdlCommon/SdlInput.cs +++ b/OpenRA.Renderer.SdlCommon/SdlInput.cs @@ -8,9 +8,7 @@ */ #endregion -using System; using System.Collections.Generic; -using System.IO; using Tao.Sdl; namespace OpenRA.Renderer.SdlCommon @@ -187,7 +185,7 @@ namespace OpenRA.Renderer.SdlCommon switch (e.type) { case Sdl.SDL_QUIT: - OpenRA.Game.Exit(); + Game.Exit(); break; case Sdl.SDL_MOUSEBUTTONDOWN: @@ -266,7 +264,7 @@ namespace OpenRA.Renderer.SdlCommon if (e.key.keysym.sym == Sdl.SDLK_F4 && mods.HasModifier(Modifiers.Alt) && Platform.CurrentPlatform == PlatformType.Windows) { - OpenRA.Game.Exit(); + Game.Exit(); } else inputHandler.OnKeyInput(keyEvent); diff --git a/OpenRA.Renderer.SdlCommon/Texture.cs b/OpenRA.Renderer.SdlCommon/Texture.cs index 978895147e..1943961fbd 100644 --- a/OpenRA.Renderer.SdlCommon/Texture.cs +++ b/OpenRA.Renderer.SdlCommon/Texture.cs @@ -12,7 +12,6 @@ using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; -using OpenRA.FileFormats; using OpenRA.FileFormats.Graphics; using Tao.OpenGl; diff --git a/OpenRA.TilesetBuilder/FormBuilder.cs b/OpenRA.TilesetBuilder/FormBuilder.cs index 34404072ed..7a56e0499f 100644 --- a/OpenRA.TilesetBuilder/FormBuilder.cs +++ b/OpenRA.TilesetBuilder/FormBuilder.cs @@ -14,7 +14,6 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Windows.Forms; using System.Xml; using OpenRA.FileFormats; @@ -430,7 +429,7 @@ namespace OpenRA.TilesetBuilder Console.WriteLine("{0} {1} {2} {3} {4} {5} {6}", cur, idx, - ((t.Key.Y * surface1.TilesPerRow) + t.Key.X).ToString(), + ((t.Key.Y * surface1.TilesPerRow) + t.Key.X), tp.Width, tp.Height, t.Key.X, diff --git a/OpenRA.TilesetBuilder/FormNew.cs b/OpenRA.TilesetBuilder/FormNew.cs index c7e03f8a1d..8c39161c40 100644 --- a/OpenRA.TilesetBuilder/FormNew.cs +++ b/OpenRA.TilesetBuilder/FormNew.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; namespace OpenRA.TilesetBuilder