Simplify names, remove unused usings, remove redundant casts.
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using OpenRA.FileSystem;
|
||||
|
||||
namespace OpenRA.Mods.Common.UtilityCommands
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRA.Scripting;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user