diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index b281737c74..284b7cc6f5 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -230,10 +230,7 @@ namespace OpenRA var err1 = FieldLoader.UnknownFieldAction; var err2 = FieldLoader.InvalidValueAction; - FieldLoader.UnknownFieldAction = (s, f) => - { - Console.WriteLine("Ignoring unknown field `{0}` on `{1}`".F(s, f.Name)); - }; + FieldLoader.UnknownFieldAction = (s, f) => Console.WriteLine("Ignoring unknown field `{0}` on `{1}`".F(s, f.Name)); if (File.Exists(settingsFile)) { diff --git a/OpenRA.Game/Widgets/ButtonWidget.cs b/OpenRA.Game/Widgets/ButtonWidget.cs index 862d2257ee..19a3a322cb 100644 --- a/OpenRA.Game/Widgets/ButtonWidget.cs +++ b/OpenRA.Game/Widgets/ButtonWidget.cs @@ -60,7 +60,7 @@ namespace OpenRA.Widgets { this.modRules = modRules; - GetText = () => { return Text; }; + GetText = () => Text; GetColor = () => TextColor; GetColorDisabled = () => TextColorDisabled; GetContrastColor = () => ContrastColor; diff --git a/OpenRA.Game/Widgets/SpriteWidget.cs b/OpenRA.Game/Widgets/SpriteWidget.cs index 5c9a5ab860..7b3fbde15c 100644 --- a/OpenRA.Game/Widgets/SpriteWidget.cs +++ b/OpenRA.Game/Widgets/SpriteWidget.cs @@ -24,7 +24,7 @@ namespace OpenRA.Widgets [ObjectCreator.UseCtor] public SpriteWidget(WorldRenderer worldRenderer) { - GetPalette = () => { return Palette; }; + GetPalette = () => Palette; this.worldRenderer = worldRenderer; } diff --git a/OpenRA.Mods.RA/DemoTruck.cs b/OpenRA.Mods.RA/DemoTruck.cs index d1ca5da41c..0835c05c1d 100644 --- a/OpenRA.Mods.RA/DemoTruck.cs +++ b/OpenRA.Mods.RA/DemoTruck.cs @@ -22,10 +22,7 @@ namespace OpenRA.Mods.RA { static void Explode(Actor self) { - self.World.AddFrameEndTask(w => - { - self.InflictDamage(self, int.MaxValue, null); - }); + self.World.AddFrameEndTask(w => self.InflictDamage(self, int.MaxValue, null)); } public IEnumerable Orders diff --git a/OpenRA.Mods.RA/Render/RenderUnit.cs b/OpenRA.Mods.RA/Render/RenderUnit.cs index 42a9d33fde..e9774a3131 100644 --- a/OpenRA.Mods.RA/Render/RenderUnit.cs +++ b/OpenRA.Mods.RA/Render/RenderUnit.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Render public void PlayCustomAnimRepeating(Actor self, string name) { DefaultAnimation.PlayThen(name, - () => { PlayCustomAnimRepeating(self, name); }); + () => PlayCustomAnimRepeating(self, name)); } public void PlayCustomAnimBackwards(Actor self, string name, Action after) diff --git a/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs index 3bbb7afe43..709734a151 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs @@ -65,19 +65,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic mirror != null ? new Uri(mirror).Host : "unknown host"); }; - Action onExtractProgress = s => - { - Game.RunAfterTick(() => statusLabel.GetText = () => s); - }; + Action onExtractProgress = s => Game.RunAfterTick(() => statusLabel.GetText = () => s); - Action onError = s => + Action onError = s => Game.RunAfterTick(() => { - Game.RunAfterTick(() => - { - statusLabel.GetText = () => "Error: " + s; - retryButton.IsVisible = () => true; - }); - }; + statusLabel.GetText = () => "Error: " + s; + retryButton.IsVisible = () => true; + }); Action onDownloadComplete = (i, cancelled) => { diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs index da5d814ce8..430ed5d044 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs @@ -66,10 +66,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic }); }; - Action onRetry = password => - { - ConnectionLogic.Connect(om.Host, om.Port, password, onConnect, onExit); - }; + Action onRetry = password => ConnectionLogic.Connect(om.Host, om.Port, password, onConnect, onExit); Ui.OpenWindow("CONNECTIONFAILED_PANEL", new WidgetArgs() { diff --git a/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs index 33f025709b..6df12589ee 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs @@ -58,8 +58,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic { replays = Directory .GetFiles(dir, "*.rep") - .Select((filename) => ReplayMetadata.Read(filename)) - .Where((r) => r != null) + .Select(ReplayMetadata.Read) + .Where(r => r != null) .OrderByDescending(r => r.GameInfo.StartTimeUtc) .ToList(); } @@ -365,14 +365,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic "Rename Replay", "Enter a new file name:", initialName, - onAccept: (newName) => - { - RenameReplay(r, newName); - }, + onAccept: newName => RenameReplay(r, newName), onCancel: null, acceptText: "Rename", cancelText: null, - inputValidator: (newName) => + inputValidator: newName => { if (newName == initialName) return false; @@ -439,7 +436,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic "Delete {0} replays?".F(list.Count), () => { - list.ForEach((r) => DeleteReplay(r)); + list.ForEach(DeleteReplay); if (selectedReplay == null) SelectFirstVisibleReplay(); },