Simplify names, remove unused usings, remove redundant casts.

This commit is contained in:
RoosterDragon
2016-01-17 21:24:41 +00:00
parent aaeb715006
commit 8e89a6a696
304 changed files with 218 additions and 639 deletions

View File

@@ -11,7 +11,6 @@
using System;
using System.IO;
using System.Linq;
using OpenRA.FileSystem;
namespace OpenRA.Mods.Common.UtilityCommands
{

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
{
Console.WriteLine("# {0}:", filename);
var yaml = MiniYaml.FromFile(filename);
ExtractLanguageStringsCommand.FromChromeLayout(ref yaml, null,
FromChromeLayout(ref yaml, null,
translatableFields.Select(t => t.Name).Distinct(), null);
using (var file = new StreamWriter(filename))
file.WriteLine(yaml.WriteToString());

View File

@@ -9,9 +9,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRA.Scripting;
using OpenRA.Traits;

View File

@@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (t.IsSubclassOf(typeof(Array)))
return "Multiple {0}".F(FriendlyTypeName(t.GetElementType()));
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(OpenRA.Primitives.Cache<,>))
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Primitives.Cache<,>))
return "Cached<{0},{1}>".F(t.GetGenericArguments().Select(FriendlyTypeName).ToArray());
if (t == typeof(int) || t == typeof(uint))

View File

@@ -266,7 +266,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
for (var i = 0; i < mapSize; i++)
{
var tileID = ms.ReadUInt16();
types[i, j] = tileID == (ushort)0 ? (ushort)255 : tileID; // RAED weirdness
types[i, j] = tileID == 0 ? (ushort)255 : tileID; // RAED weirdness
}
}

View File

@@ -82,9 +82,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
var ca = Color.FromArgb((int)a);
var cb = Color.FromArgb((int)b);
return Math.Abs((int)ca.R - (int)cb.R) +
Math.Abs((int)ca.G - (int)cb.G) +
Math.Abs((int)ca.B - (int)cb.B);
return Math.Abs(ca.R - cb.R) +
Math.Abs(ca.G - cb.G) +
Math.Abs(ca.B - cb.B);
}
}
}