Fix a collection of whitespace-style issues in Mods.Common.

This commit is contained in:
Paul Chote
2014-12-14 17:04:37 +13:00
parent 299a933dac
commit ecd3809bc2
51 changed files with 142 additions and 149 deletions

View File

@@ -21,21 +21,21 @@ namespace OpenRA.Mods.Common.Traits
public object Create(ActorInitializer init) { return new LoadWidgetAtGameStart(this); }
}
public class LoadWidgetAtGameStart: IWorldLoaded
public class LoadWidgetAtGameStart : IWorldLoaded
{
readonly LoadWidgetAtGameStartInfo Info;
public LoadWidgetAtGameStart(LoadWidgetAtGameStartInfo Info)
readonly LoadWidgetAtGameStartInfo info;
public LoadWidgetAtGameStart(LoadWidgetAtGameStartInfo info)
{
this.Info = Info;
this.info = info;
}
public void WorldLoaded(World world, WorldRenderer wr)
{
// Clear any existing widget state
if (Info.ClearRoot)
if (info.ClearRoot)
Ui.ResetAll();
Game.LoadWidget(world, Info.Widget, Ui.Root, new WidgetArgs());
Game.LoadWidget(world, info.Widget, Ui.Root, new WidgetArgs());
}
}
}

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
{
var spawns = world.Map.GetSpawnPoints().ToList();
var taken = world.LobbyInfo.Clients.Where(c => c.SpawnPoint != 0 && c.Slot != null)
.Select(c => spawns[c.SpawnPoint-1]).ToList();
.Select(c => spawns[c.SpawnPoint - 1]).ToList();
var available = spawns.Except(taken).ToList();
// Set spawn
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
var client = world.LobbyInfo.ClientInSlot(kv.Key);
var spid = (client == null || client.SpawnPoint == 0)
? ChooseSpawnPoint(world, available, taken)
: spawns[client.SpawnPoint-1];
: spawns[client.SpawnPoint - 1];
Start.Add(player, spid);
@@ -85,5 +85,4 @@ namespace OpenRA.Mods.Common.Traits
return sp;
}
}
}
}

View File

@@ -40,12 +40,11 @@ namespace OpenRA.Mods.Common.Traits
void PlayMusic()
{
var onComplete = info.Loop ? (Action)PlayMusic : () => {};
var onComplete = info.Loop ? (Action)PlayMusic : () => { };
if (Game.Settings.Sound.MapMusic &&
world.Map.Rules.Music.ContainsKey(info.Music))
Sound.PlayMusicThen(world.Map.Rules.Music[info.Music], onComplete);
}
}
}
}

View File

@@ -39,22 +39,24 @@ namespace OpenRA.Mods.Common.Traits
wr.AddPalette(info.Name, new ImmutablePalette(Enumerable.Range(0, Palette.Size).Select(i => (uint)c[i % 8].ToArgb())));
}
static Color[] Fog = new[] {
static Color[] Fog = new[]
{
Color.Transparent, Color.Green,
Color.Blue, Color.Yellow,
Color.FromArgb(128,0,0,0),
Color.FromArgb(96,0,0,0),
Color.FromArgb(64,0,0,0),
Color.FromArgb(32,0,0,0)
Color.FromArgb(128, 0, 0, 0),
Color.FromArgb(96, 0, 0, 0),
Color.FromArgb(64, 0, 0, 0),
Color.FromArgb(32, 0, 0, 0)
};
static Color[] Shroud = new[] {
static Color[] Shroud = new[]
{
Color.Transparent, Color.Green,
Color.Blue, Color.Yellow,
Color.Black,
Color.FromArgb(160,0,0,0),
Color.FromArgb(128,0,0,0),
Color.FromArgb(64,0,0,0)
Color.FromArgb(160, 0, 0, 0),
Color.FromArgb(128, 0, 0, 0),
Color.FromArgb(64, 0, 0, 0)
};
}
}

View File

@@ -9,11 +9,11 @@
#endregion
using System;
using System.Drawing;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Traits;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{