Make sure braces for multi-line statements are on their own lines.

This commit is contained in:
Paul Chote
2019-06-08 15:04:36 +01:00
committed by reaperrr
parent c89f8dbb89
commit ebf2ce32c0
34 changed files with 180 additions and 91 deletions

View File

@@ -201,7 +201,8 @@ namespace OpenRA
// Reseed the RNG so this isn't an exact repeat of the last game
lobbyInfo.GlobalSettings.RandomSeed = CosmeticRandom.Next();
var orders = new[] {
var orders = new[]
{
Order.Command("sync_lobby {0}".F(lobbyInfo.Serialize())),
Order.Command("startgame")
};

View File

@@ -320,7 +320,7 @@ namespace OpenRA.Graphics
public static float[] MakeFloatMatrix(Int32Matrix4x4 imtx)
{
var multipler = 1f / imtx.M44;
return new float[]
return new[]
{
imtx.M11 * multipler,
imtx.M12 * multipler,
@@ -352,13 +352,16 @@ namespace OpenRA.Graphics
var iz = new uint[] { 2, 5, 2, 5, 2, 5, 2, 5 };
// Vectors to opposing corner
var ret = new float[] { float.MaxValue, float.MaxValue, float.MaxValue,
float.MinValue, float.MinValue, float.MinValue };
var ret = new[]
{
float.MaxValue, float.MaxValue, float.MaxValue,
float.MinValue, float.MinValue, float.MinValue
};
// Transform vectors and find new bounding box
for (var i = 0; i < 8; i++)
{
var vec = new float[] { bounds[ix[i]], bounds[iy[i]], bounds[iz[i]], 1 };
var vec = new[] { bounds[ix[i]], bounds[iy[i]], bounds[iz[i]], 1 };
var tvec = MatrixVectorMultiply(mtx, vec);
ret[0] = Math.Min(ret[0], tvec[0] / tvec[3]);

View File

@@ -72,11 +72,14 @@ namespace OpenRA
public readonly string[] SpriteFormats = { };
public readonly string[] PackageFormats = { };
readonly string[] reservedModuleNames = { "Metadata", "Folders", "MapFolders", "Packages", "Rules",
readonly string[] reservedModuleNames =
{
"Metadata", "Folders", "MapFolders", "Packages", "Rules",
"Sequences", "ModelSequences", "Cursors", "Chrome", "Assemblies", "ChromeLayout", "Weapons",
"Voices", "Notifications", "Music", "Translations", "TileSets", "ChromeMetrics", "Missions", "Hotkeys",
"ServerTraits", "LoadScreen", "Fonts", "SupportsMapsFrom", "SoundFormats", "SpriteFormats",
"RequiresMods", "PackageFormats" };
"RequiresMods", "PackageFormats"
};
readonly TypeDictionary modules = new TypeDictionary();
readonly Dictionary<string, MiniYaml> yaml;

View File

@@ -1079,7 +1079,8 @@ namespace OpenRA
var v = rand.Next(Bounds.Top, Bounds.Bottom);
cells = Unproject(new PPos(u, v));
} while (!cells.Any());
}
while (!cells.Any());
return cells.Random(rand).ToCPos(Grid.Type);
}

View File

@@ -28,8 +28,14 @@ namespace OpenRA.Network
static bool initialized;
public static IPAddress ExternalIP { get; private set; }
public static UPnPStatus Status { get { return initialized ? natDevice != null ?
UPnPStatus.Enabled : UPnPStatus.NotSupported : UPnPStatus.Disabled; } }
public static UPnPStatus Status
{
get
{
return initialized ? natDevice != null ?
UPnPStatus.Enabled : UPnPStatus.NotSupported : UPnPStatus.Disabled;
}
}
public static async Task DiscoverNatDevices(int timeout)
{

View File

@@ -15,11 +15,14 @@ namespace OpenRA.Support
{
public static class PerfHistory
{
static readonly Color[] Colors = { Color.Red, Color.Green,
static readonly Color[] Colors =
{
Color.Red, Color.Green,
Color.Orange, Color.Yellow,
Color.Fuchsia, Color.Lime,
Color.LightBlue, Color.Blue,
Color.White, Color.Teal };
Color.White, Color.Teal
};
static int nextColor;