Renormalize line endings and fix copyright headers again.
This commit is contained in:
@@ -15,7 +15,7 @@ using System.Collections.Generic;
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class Cache<T, U> : IEnumerable<KeyValuePair<T, U>>
|
||||
{
|
||||
{
|
||||
Dictionary<T, U> hax;
|
||||
Func<T,U> loader;
|
||||
|
||||
@@ -26,10 +26,10 @@ namespace OpenRA.FileFormats
|
||||
throw new ArgumentNullException();
|
||||
|
||||
this.loader = loader;
|
||||
}
|
||||
|
||||
public Cache(Func<T, U> loader)
|
||||
: this(loader, EqualityComparer<T>.Default) { }
|
||||
}
|
||||
|
||||
public Cache(Func<T, U> loader)
|
||||
: this(loader, EqualityComparer<T>.Default) { }
|
||||
|
||||
public U this[T key]
|
||||
{
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace OpenRA.FileFormats
|
||||
p = null;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public void Force()
|
||||
{
|
||||
var ignored = Value;
|
||||
}
|
||||
|
||||
public void Force()
|
||||
{
|
||||
var ignored = Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.FileFormats
|
||||
Second = second;
|
||||
}
|
||||
|
||||
internal static IEqualityComparer<T> tc = EqualityComparer<T>.Default;
|
||||
internal static IEqualityComparer<T> tc = EqualityComparer<T>.Default;
|
||||
internal static IEqualityComparer<U> uc = EqualityComparer<U>.Default;
|
||||
|
||||
public static bool operator ==(Pair<T, U> a, Pair<T, U> b)
|
||||
@@ -60,31 +60,31 @@ namespace OpenRA.FileFormats
|
||||
public override string ToString()
|
||||
{
|
||||
return "({0},{1})".F(First, Second);
|
||||
}
|
||||
|
||||
class PairEqualityComparer : IEqualityComparer<Pair<T, U>>
|
||||
{
|
||||
public bool Equals(Pair<T, U> x, Pair<T, U> y) { return x == y; }
|
||||
public int GetHashCode(Pair<T, U> obj) { return obj.GetHashCode(); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class PairEqualityComparer : IEqualityComparer<Pair<T, U>>
|
||||
{
|
||||
public bool Equals(Pair<T, U> x, Pair<T, U> y) { return x == y; }
|
||||
public int GetHashCode(Pair<T, U> obj) { return obj.GetHashCode(); }
|
||||
}
|
||||
|
||||
public static IEqualityComparer<Pair<T, U>> EqualityComparer { get { return new PairEqualityComparer(); } }
|
||||
}
|
||||
|
||||
public static class Pair
|
||||
{
|
||||
public static Pair<T, U> New<T, U>(T t, U u) { return new Pair<T, U>(t, u); }
|
||||
|
||||
static Pair()
|
||||
{
|
||||
Pair<char,Color>.uc = new ColorEqualityComparer();
|
||||
}
|
||||
|
||||
// avoid the default crappy one
|
||||
class ColorEqualityComparer : IEqualityComparer<Color>
|
||||
{
|
||||
public bool Equals(Color x, Color y) { return x.ToArgb() == y.ToArgb(); }
|
||||
public int GetHashCode(Color obj) { return obj.GetHashCode(); }
|
||||
}
|
||||
{
|
||||
public static Pair<T, U> New<T, U>(T t, U u) { return new Pair<T, U>(t, u); }
|
||||
|
||||
static Pair()
|
||||
{
|
||||
Pair<char,Color>.uc = new ColorEqualityComparer();
|
||||
}
|
||||
|
||||
// avoid the default crappy one
|
||||
class ColorEqualityComparer : IEqualityComparer<Color>
|
||||
{
|
||||
public bool Equals(Color x, Color y) { return x.ToArgb() == y.ToArgb(); }
|
||||
public int GetHashCode(Color obj) { return obj.GetHashCode(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user