Merge pull request #4129 from ScottNZ/refactor

Refactor
This commit is contained in:
Chris Forbes
2013-11-12 00:06:01 -08:00
319 changed files with 157 additions and 639 deletions

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;

View File

@@ -314,7 +314,7 @@ namespace OpenRA.FileFormats
return null;
}
static object ParseYesNo(string p, System.Type fieldType, string field)
static object ParseYesNo(string p, Type fieldType, string field)
{
p = p.ToLowerInvariant();
if (p == "yes") return true;

View File

@@ -48,7 +48,7 @@ namespace OpenRA.FileFormats
public static MiniYamlNode SaveField(object o, string field)
{
return new MiniYamlNode(field, FieldSaver.FormatValue(o, o.GetType().GetField(field)));
return new MiniYamlNode(field, FormatValue(o, o.GetType().GetField(field)));
}
public static string FormatValue(object v, Type t)

View File

@@ -92,7 +92,7 @@ namespace OpenRA.FileFormats
/// A fast (native) CRC32 implementation that can be used on a regular byte arrays.
/// </summary>
/// <param name="data">The data from which to calculate the checksum.</param>
/// <param name="polynomal">The polynomal.</param>
/// <param name="polynomial">The polynomial.</param>
/// <returns>
/// The calculated checksum.
/// </returns>
@@ -115,7 +115,7 @@ namespace OpenRA.FileFormats
/// </summary>
/// <param name="data"> [in,out] If non-null, the.</param>
/// <param name="len"> The length of the data data.</param>
/// <param name="polynomal">The polynomal to xor with.</param>
/// <param name="polynomial">The polynomal to xor with.</param>
/// <returns>The calculated checksum.</returns>
public static unsafe uint Calculate(byte* data, uint len, uint polynomial)
{

View File

@@ -56,7 +56,7 @@ namespace OpenRA.FileFormats
IniSection ProcessSection(string line)
{
Match m = sectionPattern.Match(line);
if (m == null || !m.Success)
if (!m.Success)
return null;
string sectionName = m.Groups[1].Value.ToLowerInvariant();

View File

@@ -10,7 +10,6 @@
using System;
using System.IO;
using System.Text;
namespace OpenRA.FileFormats
{

View File

@@ -9,11 +9,8 @@
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{

View File

@@ -97,7 +97,7 @@ namespace OpenRA.FileFormats
name = Platform.SupportDir + name.Substring(1);
FolderPaths.Add(name);
Action a = () => FileSystem.MountInner(OpenPackage(name, annotation, order++));
Action a = () => MountInner(OpenPackage(name, annotation, order++));
if (optional)
try { a(); }
@@ -197,8 +197,8 @@ namespace OpenRA.FileFormats
if (assemblyCache.TryGetValue(filename, out a))
return a;
if (FileSystem.Exists(filename))
using (var s = FileSystem.Open(filename))
if (Exists(filename))
using (var s = Open(filename))
{
var buf = new byte[s.Length];
s.Read(buf, 0, buf.Length);

View File

@@ -10,7 +10,6 @@
using System.Collections.Generic;
using System.IO;
using System;
namespace OpenRA.FileFormats
{

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{

View File

@@ -9,9 +9,7 @@
#endregion
using System;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{

View File

@@ -10,7 +10,6 @@
using System;
using System.Drawing;
using System.IO;
namespace OpenRA.FileFormats.Graphics
{

View File

@@ -9,8 +9,6 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA
{

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;

View File

@@ -11,9 +11,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
namespace OpenRA.FileFormats
{

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Collections.Generic;
using System.IO;

View File

@@ -8,11 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.FileFormats;
namespace OpenRA
{
public struct Hotkey

View File

@@ -8,9 +8,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA
{

View File

@@ -8,9 +8,6 @@
*/
#endregion
using System;
using System.Drawing;
namespace OpenRA.FileFormats
{
public class PlayerReference

View File

@@ -10,8 +10,6 @@
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;

View File

@@ -23,7 +23,7 @@ namespace OpenRA.FileFormats.Primitives
public event Action<object, object> OnSet = (o, n) => { };
public event Action OnRefresh = () => { };
public ObservableCollection() : base() { }
public ObservableCollection() { }
public ObservableCollection(IList<T> list) : base(list) { }
protected override void SetItem(int index, T item)
@@ -53,7 +53,7 @@ namespace OpenRA.FileFormats.Primitives
public IEnumerable ObservedItems
{
get { return base.Items; }
get { return Items; }
}
}
}

View File

@@ -9,7 +9,6 @@
#endregion
using System.Collections.Generic;
using System;
using System.Drawing;
namespace OpenRA.FileFormats

View File

@@ -11,9 +11,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
namespace OpenRA
{

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Drawing;
namespace OpenRA
{

View File

@@ -8,10 +8,8 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
namespace OpenRA
{

View File

@@ -8,8 +8,6 @@
*/
#endregion
using System;
using System.Drawing;
using System.Linq;
namespace OpenRA

View File

@@ -8,9 +8,6 @@
*/
#endregion
using System;
using System.Drawing;
namespace OpenRA
{
/// <summary>

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Drawing;
namespace OpenRA
{