Use expression body syntax
This commit is contained in:
@@ -101,7 +101,7 @@ namespace OpenRA.Primitives
|
||||
public override bool Equals(object obj) { return obj is BitSet<T> && Equals((BitSet<T>)obj); }
|
||||
public override int GetHashCode() { return bits.GetHashCode(); }
|
||||
|
||||
public bool IsEmpty { get { return bits == 0; } }
|
||||
public bool IsEmpty => bits == 0;
|
||||
|
||||
public bool IsProperSubsetOf(BitSet<T> other)
|
||||
{
|
||||
|
||||
@@ -31,18 +31,15 @@ namespace OpenRA.Primitives
|
||||
public Cache(Func<T, U> loader)
|
||||
: this(loader, EqualityComparer<T>.Default) { }
|
||||
|
||||
public U this[T key]
|
||||
{
|
||||
get { return cache.GetOrAdd(key, loader); }
|
||||
}
|
||||
public U this[T key] => cache.GetOrAdd(key, loader);
|
||||
|
||||
public bool ContainsKey(T key) { return cache.ContainsKey(key); }
|
||||
public bool TryGetValue(T key, out U value) { return cache.TryGetValue(key, out value); }
|
||||
public int Count { get { return cache.Count; } }
|
||||
public int Count => cache.Count;
|
||||
public void Clear() { cache.Clear(); }
|
||||
|
||||
public ICollection<T> Keys { get { return cache.Keys; } }
|
||||
public ICollection<U> Values { get { return cache.Values; } }
|
||||
public ICollection<T> Keys => cache.Keys;
|
||||
public ICollection<U> Values => cache.Values;
|
||||
public IEnumerator<KeyValuePair<T, U>> GetEnumerator() { return cache.GetEnumerator(); }
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); }
|
||||
}
|
||||
|
||||
@@ -195,10 +195,10 @@ namespace OpenRA.Primitives
|
||||
return hue;
|
||||
}
|
||||
|
||||
public byte A { get { return (byte)(argb >> 24); } }
|
||||
public byte R { get { return (byte)(argb >> 16); } }
|
||||
public byte G { get { return (byte)(argb >> 8); } }
|
||||
public byte B { get { return (byte)argb; } }
|
||||
public byte A => (byte)(argb >> 24);
|
||||
public byte R => (byte)(argb >> 16);
|
||||
public byte G => (byte)(argb >> 8);
|
||||
public byte B => (byte)argb;
|
||||
|
||||
public bool Equals(Color other)
|
||||
{
|
||||
@@ -226,146 +226,146 @@ namespace OpenRA.Primitives
|
||||
return R.ToString("X2") + G.ToString("X2") + B.ToString("X2") + A.ToString("X2");
|
||||
}
|
||||
|
||||
public static Color Transparent { get { return FromArgb(0x00FFFFFF); } }
|
||||
public static Color AliceBlue { get { return FromArgb(0xFFF0F8FF); } }
|
||||
public static Color AntiqueWhite { get { return FromArgb(0xFFFAEBD7); } }
|
||||
public static Color Aqua { get { return FromArgb(0xFF00FFFF); } }
|
||||
public static Color Aquamarine { get { return FromArgb(0xFF7FFFD4); } }
|
||||
public static Color Azure { get { return FromArgb(0xFFF0FFFF); } }
|
||||
public static Color Beige { get { return FromArgb(0xFFF5F5DC); } }
|
||||
public static Color Bisque { get { return FromArgb(0xFFFFE4C4); } }
|
||||
public static Color Black { get { return FromArgb(0xFF000000); } }
|
||||
public static Color BlanchedAlmond { get { return FromArgb(0xFFFFEBCD); } }
|
||||
public static Color Blue { get { return FromArgb(0xFF0000FF); } }
|
||||
public static Color BlueViolet { get { return FromArgb(0xFF8A2BE2); } }
|
||||
public static Color Brown { get { return FromArgb(0xFFA52A2A); } }
|
||||
public static Color BurlyWood { get { return FromArgb(0xFFDEB887); } }
|
||||
public static Color CadetBlue { get { return FromArgb(0xFF5F9EA0); } }
|
||||
public static Color Chartreuse { get { return FromArgb(0xFF7FFF00); } }
|
||||
public static Color Chocolate { get { return FromArgb(0xFFD2691E); } }
|
||||
public static Color Coral { get { return FromArgb(0xFFFF7F50); } }
|
||||
public static Color CornflowerBlue { get { return FromArgb(0xFF6495ED); } }
|
||||
public static Color Cornsilk { get { return FromArgb(0xFFFFF8DC); } }
|
||||
public static Color Crimson { get { return FromArgb(0xFFDC143C); } }
|
||||
public static Color Cyan { get { return FromArgb(0xFF00FFFF); } }
|
||||
public static Color DarkBlue { get { return FromArgb(0xFF00008B); } }
|
||||
public static Color DarkCyan { get { return FromArgb(0xFF008B8B); } }
|
||||
public static Color DarkGoldenrod { get { return FromArgb(0xFFB8860B); } }
|
||||
public static Color DarkGray { get { return FromArgb(0xFFA9A9A9); } }
|
||||
public static Color DarkGreen { get { return FromArgb(0xFF006400); } }
|
||||
public static Color DarkKhaki { get { return FromArgb(0xFFBDB76B); } }
|
||||
public static Color DarkMagenta { get { return FromArgb(0xFF8B008B); } }
|
||||
public static Color DarkOliveGreen { get { return FromArgb(0xFF556B2F); } }
|
||||
public static Color DarkOrange { get { return FromArgb(0xFFFF8C00); } }
|
||||
public static Color DarkOrchid { get { return FromArgb(0xFF9932CC); } }
|
||||
public static Color DarkRed { get { return FromArgb(0xFF8B0000); } }
|
||||
public static Color DarkSalmon { get { return FromArgb(0xFFE9967A); } }
|
||||
public static Color DarkSeaGreen { get { return FromArgb(0xFF8FBC8B); } }
|
||||
public static Color DarkSlateBlue { get { return FromArgb(0xFF483D8B); } }
|
||||
public static Color DarkSlateGray { get { return FromArgb(0xFF2F4F4F); } }
|
||||
public static Color DarkTurquoise { get { return FromArgb(0xFF00CED1); } }
|
||||
public static Color DarkViolet { get { return FromArgb(0xFF9400D3); } }
|
||||
public static Color DeepPink { get { return FromArgb(0xFFFF1493); } }
|
||||
public static Color DeepSkyBlue { get { return FromArgb(0xFF00BFFF); } }
|
||||
public static Color DimGray { get { return FromArgb(0xFF696969); } }
|
||||
public static Color DodgerBlue { get { return FromArgb(0xFF1E90FF); } }
|
||||
public static Color Firebrick { get { return FromArgb(0xFFB22222); } }
|
||||
public static Color FloralWhite { get { return FromArgb(0xFFFFFAF0); } }
|
||||
public static Color ForestGreen { get { return FromArgb(0xFF228B22); } }
|
||||
public static Color Fuchsia { get { return FromArgb(0xFFFF00FF); } }
|
||||
public static Color Gainsboro { get { return FromArgb(0xFFDCDCDC); } }
|
||||
public static Color GhostWhite { get { return FromArgb(0xFFF8F8FF); } }
|
||||
public static Color Gold { get { return FromArgb(0xFFFFD700); } }
|
||||
public static Color Goldenrod { get { return FromArgb(0xFFDAA520); } }
|
||||
public static Color Gray { get { return FromArgb(0xFF808080); } }
|
||||
public static Color Green { get { return FromArgb(0xFF008000); } }
|
||||
public static Color GreenYellow { get { return FromArgb(0xFFADFF2F); } }
|
||||
public static Color Honeydew { get { return FromArgb(0xFFF0FFF0); } }
|
||||
public static Color HotPink { get { return FromArgb(0xFFFF69B4); } }
|
||||
public static Color IndianRed { get { return FromArgb(0xFFCD5C5C); } }
|
||||
public static Color Indigo { get { return FromArgb(0xFF4B0082); } }
|
||||
public static Color Ivory { get { return FromArgb(0xFFFFFFF0); } }
|
||||
public static Color Khaki { get { return FromArgb(0xFFF0E68C); } }
|
||||
public static Color Lavender { get { return FromArgb(0xFFE6E6FA); } }
|
||||
public static Color LavenderBlush { get { return FromArgb(0xFFFFF0F5); } }
|
||||
public static Color LawnGreen { get { return FromArgb(0xFF7CFC00); } }
|
||||
public static Color LemonChiffon { get { return FromArgb(0xFFFFFACD); } }
|
||||
public static Color LightBlue { get { return FromArgb(0xFFADD8E6); } }
|
||||
public static Color LightCoral { get { return FromArgb(0xFFF08080); } }
|
||||
public static Color LightCyan { get { return FromArgb(0xFFE0FFFF); } }
|
||||
public static Color LightGoldenrodYellow { get { return FromArgb(0xFFFAFAD2); } }
|
||||
public static Color LightGray { get { return FromArgb(0xFFD3D3D3); } }
|
||||
public static Color LightGreen { get { return FromArgb(0xFF90EE90); } }
|
||||
public static Color LightPink { get { return FromArgb(0xFFFFB6C1); } }
|
||||
public static Color LightSalmon { get { return FromArgb(0xFFFFA07A); } }
|
||||
public static Color LightSeaGreen { get { return FromArgb(0xFF20B2AA); } }
|
||||
public static Color LightSkyBlue { get { return FromArgb(0xFF87CEFA); } }
|
||||
public static Color LightSlateGray { get { return FromArgb(0xFF778899); } }
|
||||
public static Color LightSteelBlue { get { return FromArgb(0xFFB0C4DE); } }
|
||||
public static Color LightYellow { get { return FromArgb(0xFFFFFFE0); } }
|
||||
public static Color Lime { get { return FromArgb(0xFF00FF00); } }
|
||||
public static Color LimeGreen { get { return FromArgb(0xFF32CD32); } }
|
||||
public static Color Linen { get { return FromArgb(0xFFFAF0E6); } }
|
||||
public static Color Magenta { get { return FromArgb(0xFFFF00FF); } }
|
||||
public static Color Maroon { get { return FromArgb(0xFF800000); } }
|
||||
public static Color MediumAquamarine { get { return FromArgb(0xFF66CDAA); } }
|
||||
public static Color MediumBlue { get { return FromArgb(0xFF0000CD); } }
|
||||
public static Color MediumOrchid { get { return FromArgb(0xFFBA55D3); } }
|
||||
public static Color MediumPurple { get { return FromArgb(0xFF9370DB); } }
|
||||
public static Color MediumSeaGreen { get { return FromArgb(0xFF3CB371); } }
|
||||
public static Color MediumSlateBlue { get { return FromArgb(0xFF7B68EE); } }
|
||||
public static Color MediumSpringGreen { get { return FromArgb(0xFF00FA9A); } }
|
||||
public static Color MediumTurquoise { get { return FromArgb(0xFF48D1CC); } }
|
||||
public static Color MediumVioletRed { get { return FromArgb(0xFFC71585); } }
|
||||
public static Color MidnightBlue { get { return FromArgb(0xFF191970); } }
|
||||
public static Color MintCream { get { return FromArgb(0xFFF5FFFA); } }
|
||||
public static Color MistyRose { get { return FromArgb(0xFFFFE4E1); } }
|
||||
public static Color Moccasin { get { return FromArgb(0xFFFFE4B5); } }
|
||||
public static Color NavajoWhite { get { return FromArgb(0xFFFFDEAD); } }
|
||||
public static Color Navy { get { return FromArgb(0xFF000080); } }
|
||||
public static Color OldLace { get { return FromArgb(0xFFFDF5E6); } }
|
||||
public static Color Olive { get { return FromArgb(0xFF808000); } }
|
||||
public static Color OliveDrab { get { return FromArgb(0xFF6B8E23); } }
|
||||
public static Color Orange { get { return FromArgb(0xFFFFA500); } }
|
||||
public static Color OrangeRed { get { return FromArgb(0xFFFF4500); } }
|
||||
public static Color Orchid { get { return FromArgb(0xFFDA70D6); } }
|
||||
public static Color PaleGoldenrod { get { return FromArgb(0xFFEEE8AA); } }
|
||||
public static Color PaleGreen { get { return FromArgb(0xFF98FB98); } }
|
||||
public static Color PaleTurquoise { get { return FromArgb(0xFFAFEEEE); } }
|
||||
public static Color PaleVioletRed { get { return FromArgb(0xFFDB7093); } }
|
||||
public static Color PapayaWhip { get { return FromArgb(0xFFFFEFD5); } }
|
||||
public static Color PeachPuff { get { return FromArgb(0xFFFFDAB9); } }
|
||||
public static Color Peru { get { return FromArgb(0xFFCD853F); } }
|
||||
public static Color Pink { get { return FromArgb(0xFFFFC0CB); } }
|
||||
public static Color Plum { get { return FromArgb(0xFFDDA0DD); } }
|
||||
public static Color PowderBlue { get { return FromArgb(0xFFB0E0E6); } }
|
||||
public static Color Purple { get { return FromArgb(0xFF800080); } }
|
||||
public static Color Red { get { return FromArgb(0xFFFF0000); } }
|
||||
public static Color RosyBrown { get { return FromArgb(0xFFBC8F8F); } }
|
||||
public static Color RoyalBlue { get { return FromArgb(0xFF4169E1); } }
|
||||
public static Color SaddleBrown { get { return FromArgb(0xFF8B4513); } }
|
||||
public static Color Salmon { get { return FromArgb(0xFFFA8072); } }
|
||||
public static Color SandyBrown { get { return FromArgb(0xFFF4A460); } }
|
||||
public static Color SeaGreen { get { return FromArgb(0xFF2E8B57); } }
|
||||
public static Color SeaShell { get { return FromArgb(0xFFFFF5EE); } }
|
||||
public static Color Sienna { get { return FromArgb(0xFFA0522D); } }
|
||||
public static Color Silver { get { return FromArgb(0xFFC0C0C0); } }
|
||||
public static Color SkyBlue { get { return FromArgb(0xFF87CEEB); } }
|
||||
public static Color SlateBlue { get { return FromArgb(0xFF6A5ACD); } }
|
||||
public static Color SlateGray { get { return FromArgb(0xFF708090); } }
|
||||
public static Color Snow { get { return FromArgb(0xFFFFFAFA); } }
|
||||
public static Color SpringGreen { get { return FromArgb(0xFF00FF7F); } }
|
||||
public static Color SteelBlue { get { return FromArgb(0xFF4682B4); } }
|
||||
public static Color Tan { get { return FromArgb(0xFFD2B48C); } }
|
||||
public static Color Teal { get { return FromArgb(0xFF008080); } }
|
||||
public static Color Thistle { get { return FromArgb(0xFFD8BFD8); } }
|
||||
public static Color Tomato { get { return FromArgb(0xFFFF6347); } }
|
||||
public static Color Turquoise { get { return FromArgb(0xFF40E0D0); } }
|
||||
public static Color Violet { get { return FromArgb(0xFFEE82EE); } }
|
||||
public static Color Wheat { get { return FromArgb(0xFFF5DEB3); } }
|
||||
public static Color White { get { return FromArgb(0xFFFFFFFF); } }
|
||||
public static Color WhiteSmoke { get { return FromArgb(0xFFF5F5F5); } }
|
||||
public static Color Yellow { get { return FromArgb(0xFFFFFF00); } }
|
||||
public static Color YellowGreen { get { return FromArgb(0xFF9ACD32); } }
|
||||
public static Color Transparent => FromArgb(0x00FFFFFF);
|
||||
public static Color AliceBlue => FromArgb(0xFFF0F8FF);
|
||||
public static Color AntiqueWhite => FromArgb(0xFFFAEBD7);
|
||||
public static Color Aqua => FromArgb(0xFF00FFFF);
|
||||
public static Color Aquamarine => FromArgb(0xFF7FFFD4);
|
||||
public static Color Azure => FromArgb(0xFFF0FFFF);
|
||||
public static Color Beige => FromArgb(0xFFF5F5DC);
|
||||
public static Color Bisque => FromArgb(0xFFFFE4C4);
|
||||
public static Color Black => FromArgb(0xFF000000);
|
||||
public static Color BlanchedAlmond => FromArgb(0xFFFFEBCD);
|
||||
public static Color Blue => FromArgb(0xFF0000FF);
|
||||
public static Color BlueViolet => FromArgb(0xFF8A2BE2);
|
||||
public static Color Brown => FromArgb(0xFFA52A2A);
|
||||
public static Color BurlyWood => FromArgb(0xFFDEB887);
|
||||
public static Color CadetBlue => FromArgb(0xFF5F9EA0);
|
||||
public static Color Chartreuse => FromArgb(0xFF7FFF00);
|
||||
public static Color Chocolate => FromArgb(0xFFD2691E);
|
||||
public static Color Coral => FromArgb(0xFFFF7F50);
|
||||
public static Color CornflowerBlue => FromArgb(0xFF6495ED);
|
||||
public static Color Cornsilk => FromArgb(0xFFFFF8DC);
|
||||
public static Color Crimson => FromArgb(0xFFDC143C);
|
||||
public static Color Cyan => FromArgb(0xFF00FFFF);
|
||||
public static Color DarkBlue => FromArgb(0xFF00008B);
|
||||
public static Color DarkCyan => FromArgb(0xFF008B8B);
|
||||
public static Color DarkGoldenrod => FromArgb(0xFFB8860B);
|
||||
public static Color DarkGray => FromArgb(0xFFA9A9A9);
|
||||
public static Color DarkGreen => FromArgb(0xFF006400);
|
||||
public static Color DarkKhaki => FromArgb(0xFFBDB76B);
|
||||
public static Color DarkMagenta => FromArgb(0xFF8B008B);
|
||||
public static Color DarkOliveGreen => FromArgb(0xFF556B2F);
|
||||
public static Color DarkOrange => FromArgb(0xFFFF8C00);
|
||||
public static Color DarkOrchid => FromArgb(0xFF9932CC);
|
||||
public static Color DarkRed => FromArgb(0xFF8B0000);
|
||||
public static Color DarkSalmon => FromArgb(0xFFE9967A);
|
||||
public static Color DarkSeaGreen => FromArgb(0xFF8FBC8B);
|
||||
public static Color DarkSlateBlue => FromArgb(0xFF483D8B);
|
||||
public static Color DarkSlateGray => FromArgb(0xFF2F4F4F);
|
||||
public static Color DarkTurquoise => FromArgb(0xFF00CED1);
|
||||
public static Color DarkViolet => FromArgb(0xFF9400D3);
|
||||
public static Color DeepPink => FromArgb(0xFFFF1493);
|
||||
public static Color DeepSkyBlue => FromArgb(0xFF00BFFF);
|
||||
public static Color DimGray => FromArgb(0xFF696969);
|
||||
public static Color DodgerBlue => FromArgb(0xFF1E90FF);
|
||||
public static Color Firebrick => FromArgb(0xFFB22222);
|
||||
public static Color FloralWhite => FromArgb(0xFFFFFAF0);
|
||||
public static Color ForestGreen => FromArgb(0xFF228B22);
|
||||
public static Color Fuchsia => FromArgb(0xFFFF00FF);
|
||||
public static Color Gainsboro => FromArgb(0xFFDCDCDC);
|
||||
public static Color GhostWhite => FromArgb(0xFFF8F8FF);
|
||||
public static Color Gold => FromArgb(0xFFFFD700);
|
||||
public static Color Goldenrod => FromArgb(0xFFDAA520);
|
||||
public static Color Gray => FromArgb(0xFF808080);
|
||||
public static Color Green => FromArgb(0xFF008000);
|
||||
public static Color GreenYellow => FromArgb(0xFFADFF2F);
|
||||
public static Color Honeydew => FromArgb(0xFFF0FFF0);
|
||||
public static Color HotPink => FromArgb(0xFFFF69B4);
|
||||
public static Color IndianRed => FromArgb(0xFFCD5C5C);
|
||||
public static Color Indigo => FromArgb(0xFF4B0082);
|
||||
public static Color Ivory => FromArgb(0xFFFFFFF0);
|
||||
public static Color Khaki => FromArgb(0xFFF0E68C);
|
||||
public static Color Lavender => FromArgb(0xFFE6E6FA);
|
||||
public static Color LavenderBlush => FromArgb(0xFFFFF0F5);
|
||||
public static Color LawnGreen => FromArgb(0xFF7CFC00);
|
||||
public static Color LemonChiffon => FromArgb(0xFFFFFACD);
|
||||
public static Color LightBlue => FromArgb(0xFFADD8E6);
|
||||
public static Color LightCoral => FromArgb(0xFFF08080);
|
||||
public static Color LightCyan => FromArgb(0xFFE0FFFF);
|
||||
public static Color LightGoldenrodYellow => FromArgb(0xFFFAFAD2);
|
||||
public static Color LightGray => FromArgb(0xFFD3D3D3);
|
||||
public static Color LightGreen => FromArgb(0xFF90EE90);
|
||||
public static Color LightPink => FromArgb(0xFFFFB6C1);
|
||||
public static Color LightSalmon => FromArgb(0xFFFFA07A);
|
||||
public static Color LightSeaGreen => FromArgb(0xFF20B2AA);
|
||||
public static Color LightSkyBlue => FromArgb(0xFF87CEFA);
|
||||
public static Color LightSlateGray => FromArgb(0xFF778899);
|
||||
public static Color LightSteelBlue => FromArgb(0xFFB0C4DE);
|
||||
public static Color LightYellow => FromArgb(0xFFFFFFE0);
|
||||
public static Color Lime => FromArgb(0xFF00FF00);
|
||||
public static Color LimeGreen => FromArgb(0xFF32CD32);
|
||||
public static Color Linen => FromArgb(0xFFFAF0E6);
|
||||
public static Color Magenta => FromArgb(0xFFFF00FF);
|
||||
public static Color Maroon => FromArgb(0xFF800000);
|
||||
public static Color MediumAquamarine => FromArgb(0xFF66CDAA);
|
||||
public static Color MediumBlue => FromArgb(0xFF0000CD);
|
||||
public static Color MediumOrchid => FromArgb(0xFFBA55D3);
|
||||
public static Color MediumPurple => FromArgb(0xFF9370DB);
|
||||
public static Color MediumSeaGreen => FromArgb(0xFF3CB371);
|
||||
public static Color MediumSlateBlue => FromArgb(0xFF7B68EE);
|
||||
public static Color MediumSpringGreen => FromArgb(0xFF00FA9A);
|
||||
public static Color MediumTurquoise => FromArgb(0xFF48D1CC);
|
||||
public static Color MediumVioletRed => FromArgb(0xFFC71585);
|
||||
public static Color MidnightBlue => FromArgb(0xFF191970);
|
||||
public static Color MintCream => FromArgb(0xFFF5FFFA);
|
||||
public static Color MistyRose => FromArgb(0xFFFFE4E1);
|
||||
public static Color Moccasin => FromArgb(0xFFFFE4B5);
|
||||
public static Color NavajoWhite => FromArgb(0xFFFFDEAD);
|
||||
public static Color Navy => FromArgb(0xFF000080);
|
||||
public static Color OldLace => FromArgb(0xFFFDF5E6);
|
||||
public static Color Olive => FromArgb(0xFF808000);
|
||||
public static Color OliveDrab => FromArgb(0xFF6B8E23);
|
||||
public static Color Orange => FromArgb(0xFFFFA500);
|
||||
public static Color OrangeRed => FromArgb(0xFFFF4500);
|
||||
public static Color Orchid => FromArgb(0xFFDA70D6);
|
||||
public static Color PaleGoldenrod => FromArgb(0xFFEEE8AA);
|
||||
public static Color PaleGreen => FromArgb(0xFF98FB98);
|
||||
public static Color PaleTurquoise => FromArgb(0xFFAFEEEE);
|
||||
public static Color PaleVioletRed => FromArgb(0xFFDB7093);
|
||||
public static Color PapayaWhip => FromArgb(0xFFFFEFD5);
|
||||
public static Color PeachPuff => FromArgb(0xFFFFDAB9);
|
||||
public static Color Peru => FromArgb(0xFFCD853F);
|
||||
public static Color Pink => FromArgb(0xFFFFC0CB);
|
||||
public static Color Plum => FromArgb(0xFFDDA0DD);
|
||||
public static Color PowderBlue => FromArgb(0xFFB0E0E6);
|
||||
public static Color Purple => FromArgb(0xFF800080);
|
||||
public static Color Red => FromArgb(0xFFFF0000);
|
||||
public static Color RosyBrown => FromArgb(0xFFBC8F8F);
|
||||
public static Color RoyalBlue => FromArgb(0xFF4169E1);
|
||||
public static Color SaddleBrown => FromArgb(0xFF8B4513);
|
||||
public static Color Salmon => FromArgb(0xFFFA8072);
|
||||
public static Color SandyBrown => FromArgb(0xFFF4A460);
|
||||
public static Color SeaGreen => FromArgb(0xFF2E8B57);
|
||||
public static Color SeaShell => FromArgb(0xFFFFF5EE);
|
||||
public static Color Sienna => FromArgb(0xFFA0522D);
|
||||
public static Color Silver => FromArgb(0xFFC0C0C0);
|
||||
public static Color SkyBlue => FromArgb(0xFF87CEEB);
|
||||
public static Color SlateBlue => FromArgb(0xFF6A5ACD);
|
||||
public static Color SlateGray => FromArgb(0xFF708090);
|
||||
public static Color Snow => FromArgb(0xFFFFFAFA);
|
||||
public static Color SpringGreen => FromArgb(0xFF00FF7F);
|
||||
public static Color SteelBlue => FromArgb(0xFF4682B4);
|
||||
public static Color Tan => FromArgb(0xFFD2B48C);
|
||||
public static Color Teal => FromArgb(0xFF008080);
|
||||
public static Color Thistle => FromArgb(0xFFD8BFD8);
|
||||
public static Color Tomato => FromArgb(0xFFFF6347);
|
||||
public static Color Turquoise => FromArgb(0xFF40E0D0);
|
||||
public static Color Violet => FromArgb(0xFFEE82EE);
|
||||
public static Color Wheat => FromArgb(0xFFF5DEB3);
|
||||
public static Color White => FromArgb(0xFFFFFFFF);
|
||||
public static Color WhiteSmoke => FromArgb(0xFFF5F5F5);
|
||||
public static Color Yellow => FromArgb(0xFFFFFF00);
|
||||
public static Color YellowGreen => FromArgb(0xFF9ACD32);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,16 +32,13 @@ namespace OpenRA.Primitives
|
||||
public ConcurrentCache(Func<T, U> loader)
|
||||
: this(loader, EqualityComparer<T>.Default) { }
|
||||
|
||||
public U this[T key]
|
||||
{
|
||||
get { return cache.GetOrAdd(key, loader); }
|
||||
}
|
||||
public U this[T key] => cache.GetOrAdd(key, loader);
|
||||
|
||||
public bool ContainsKey(T key) { return cache.ContainsKey(key); }
|
||||
public bool TryGetValue(T key, out U value) { return cache.TryGetValue(key, out value); }
|
||||
public int Count { get { return cache.Count; } }
|
||||
public ICollection<T> Keys { get { return cache.Keys; } }
|
||||
public ICollection<U> Values { get { return cache.Values; } }
|
||||
public int Count => cache.Count;
|
||||
public ICollection<T> Keys => cache.Keys;
|
||||
public ICollection<U> Values => cache.Values;
|
||||
public IEnumerator<KeyValuePair<T, U>> GetEnumerator() { return cache.GetEnumerator(); }
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); }
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRA.Primitives
|
||||
}
|
||||
}
|
||||
|
||||
public static long Mask { get { return allBits; } }
|
||||
public static long Mask => allBits;
|
||||
}
|
||||
|
||||
// Opitmized BitSet to be used only when guaranteed to be no more than 64 values.
|
||||
@@ -124,7 +124,7 @@ namespace OpenRA.Primitives
|
||||
public override bool Equals(object obj) { return obj is LongBitSet<T> && Equals((LongBitSet<T>)obj); }
|
||||
public override int GetHashCode() { return bits.GetHashCode(); }
|
||||
|
||||
public bool IsEmpty { get { return bits == 0; } }
|
||||
public bool IsEmpty => bits == 0;
|
||||
|
||||
public bool IsProperSubsetOf(LongBitSet<T> other)
|
||||
{
|
||||
|
||||
@@ -108,30 +108,18 @@ namespace OpenRA.Primitives
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override bool CanRead
|
||||
{
|
||||
get { return Stream1.CanRead && Stream2.CanRead; }
|
||||
}
|
||||
public override bool CanRead => Stream1.CanRead && Stream2.CanRead;
|
||||
|
||||
public override bool CanSeek
|
||||
{
|
||||
get { return Stream1.CanSeek && Stream2.CanSeek; }
|
||||
}
|
||||
public override bool CanSeek => Stream1.CanSeek && Stream2.CanSeek;
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
public override bool CanWrite => false;
|
||||
|
||||
public override long Length
|
||||
{
|
||||
get { return VirtualLength; }
|
||||
}
|
||||
public override long Length => VirtualLength;
|
||||
|
||||
public override long Position
|
||||
{
|
||||
get { return position; }
|
||||
set { Seek(value, SeekOrigin.Begin); }
|
||||
get => position;
|
||||
set => Seek(value, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,9 +57,6 @@ namespace OpenRA.Primitives
|
||||
OnRemoveAt(this, index);
|
||||
}
|
||||
|
||||
public IEnumerable ObservedItems
|
||||
{
|
||||
get { return Items; }
|
||||
}
|
||||
public IEnumerable ObservedItems => Items;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ namespace OpenRA.Primitives
|
||||
return innerDict.ContainsKey(key);
|
||||
}
|
||||
|
||||
public ICollection<TKey> Keys { get { return innerDict.Keys; } }
|
||||
public ICollection<TValue> Values { get { return innerDict.Values; } }
|
||||
public ICollection<TKey> Keys => innerDict.Keys;
|
||||
public ICollection<TValue> Values => innerDict.Values;
|
||||
|
||||
public bool TryGetValue(TKey key, out TValue value)
|
||||
{
|
||||
@@ -84,8 +84,8 @@ namespace OpenRA.Primitives
|
||||
|
||||
public TValue this[TKey key]
|
||||
{
|
||||
get { return innerDict[key]; }
|
||||
set { innerDict[key] = value; }
|
||||
get => innerDict[key];
|
||||
set => innerDict[key] = value;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
@@ -94,10 +94,7 @@ namespace OpenRA.Primitives
|
||||
OnRefresh(this);
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return innerDict.Count; }
|
||||
}
|
||||
public int Count => innerDict.Count;
|
||||
|
||||
public void Add(KeyValuePair<TKey, TValue> item)
|
||||
{
|
||||
@@ -114,10 +111,7 @@ namespace OpenRA.Primitives
|
||||
innerDict.CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get { return innerDict.IsReadOnly; }
|
||||
}
|
||||
public bool IsReadOnly => innerDict.IsReadOnly;
|
||||
|
||||
public bool Remove(KeyValuePair<TKey, TValue> item)
|
||||
{
|
||||
@@ -134,9 +128,6 @@ namespace OpenRA.Primitives
|
||||
return innerDict.GetEnumerator();
|
||||
}
|
||||
|
||||
public IEnumerable ObservedItems
|
||||
{
|
||||
get { return innerDict.Keys; }
|
||||
}
|
||||
public IEnumerable ObservedItems => innerDict.Keys;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace OpenRA.Primitives
|
||||
OnRefresh(this);
|
||||
}
|
||||
|
||||
public int Count { get { return innerList.Count; } }
|
||||
public int Count => innerList.Count;
|
||||
public int IndexOf(T item) { return innerList.IndexOf(item); }
|
||||
public bool Contains(T item) { return innerList.Contains(item); }
|
||||
|
||||
@@ -78,10 +78,7 @@ namespace OpenRA.Primitives
|
||||
|
||||
public T this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return innerList[index];
|
||||
}
|
||||
get => innerList[index];
|
||||
|
||||
set
|
||||
{
|
||||
@@ -106,14 +103,8 @@ namespace OpenRA.Primitives
|
||||
return innerList.GetEnumerator();
|
||||
}
|
||||
|
||||
public IEnumerable ObservedItems
|
||||
{
|
||||
get { return innerList; }
|
||||
}
|
||||
public IEnumerable ObservedItems => innerList;
|
||||
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get { return innerList.IsReadOnly; }
|
||||
}
|
||||
public bool IsReadOnly => innerList.IsReadOnly;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,16 +46,16 @@ namespace OpenRA.Primitives
|
||||
{ }
|
||||
|
||||
/// <summary>Gets the value for the specified player. This is slower than specifying a player index.</summary>
|
||||
public T this[Player player] { get { return valueByPlayer[player]; } }
|
||||
public T this[Player player] => valueByPlayer[player];
|
||||
|
||||
/// <summary>Gets the value for the specified player index.</summary>
|
||||
public T this[int playerIndex] { get { return valueByPlayerIndex[playerIndex]; } }
|
||||
public T this[int playerIndex] => valueByPlayerIndex[playerIndex];
|
||||
|
||||
public int Count { get { return valueByPlayerIndex.Length; } }
|
||||
public int Count => valueByPlayerIndex.Length;
|
||||
public IEnumerator<T> GetEnumerator() { return ((IEnumerable<T>)valueByPlayerIndex).GetEnumerator(); }
|
||||
|
||||
ICollection<Player> IReadOnlyDictionary<Player, T>.Keys { get { return valueByPlayer.Keys; } }
|
||||
ICollection<T> IReadOnlyDictionary<Player, T>.Values { get { return valueByPlayer.Values; } }
|
||||
ICollection<Player> IReadOnlyDictionary<Player, T>.Keys => valueByPlayer.Keys;
|
||||
ICollection<T> IReadOnlyDictionary<Player, T>.Values => valueByPlayer.Values;
|
||||
bool IReadOnlyDictionary<Player, T>.ContainsKey(Player key) { return valueByPlayer.ContainsKey(key); }
|
||||
bool IReadOnlyDictionary<Player, T>.TryGetValue(Player key, out T value) { return valueByPlayer.TryGetValue(key, out value); }
|
||||
IEnumerator<KeyValuePair<Player, T>> IEnumerable<KeyValuePair<Player, T>>.GetEnumerator() { return valueByPlayer.GetEnumerator(); }
|
||||
|
||||
@@ -57,7 +57,8 @@ namespace OpenRA.Primitives
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEmpty { get { return BoundingRect.IsEmpty; } }
|
||||
public bool IsEmpty => BoundingRect.IsEmpty;
|
||||
|
||||
public bool Contains(int2 xy)
|
||||
{
|
||||
return isRectangle ? BoundingRect.Contains(xy) : Vertices.PolygonContains(xy);
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA.Primitives
|
||||
}
|
||||
}
|
||||
|
||||
public bool Empty { get { return level == 0; } }
|
||||
public bool Empty => level == 0;
|
||||
|
||||
T At(int level, int index) { return items[level][index]; }
|
||||
T Above(int level, int index) { return items[level - 1][index >> 1]; }
|
||||
|
||||
@@ -35,15 +35,16 @@ namespace OpenRA.Primitives
|
||||
baseStream = stream;
|
||||
}
|
||||
|
||||
public sealed override bool CanSeek { get { return false; } }
|
||||
public sealed override bool CanRead { get { return true; } }
|
||||
public sealed override bool CanWrite { get { return false; } }
|
||||
public sealed override bool CanSeek => false;
|
||||
public sealed override bool CanRead => true;
|
||||
public sealed override bool CanWrite => false;
|
||||
|
||||
public override long Length => throw new NotSupportedException();
|
||||
|
||||
public override long Length { get { throw new NotSupportedException(); } }
|
||||
public sealed override long Position
|
||||
{
|
||||
get { throw new NotSupportedException(); }
|
||||
set { throw new NotSupportedException(); }
|
||||
get => throw new NotSupportedException();
|
||||
set => throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public sealed override long Seek(long offset, SeekOrigin origin) { throw new NotSupportedException(); }
|
||||
|
||||
@@ -73,13 +73,14 @@ namespace OpenRA
|
||||
return dict.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
public int Count { get { return dict.Count; } }
|
||||
public int Count => dict.Count;
|
||||
|
||||
public TValue this[TKey key] { get { return dict[key]; } }
|
||||
public TValue this[TKey key] => dict[key];
|
||||
|
||||
public ICollection<TKey> Keys { get { return dict.Keys; } }
|
||||
public ICollection<TKey> Keys => dict.Keys;
|
||||
|
||||
public ICollection<TValue> Values => dict.Values;
|
||||
|
||||
public ICollection<TValue> Values { get { return dict.Values; } }
|
||||
#endregion
|
||||
|
||||
#region IEnumerable implementation
|
||||
|
||||
@@ -72,9 +72,10 @@ namespace OpenRA
|
||||
#endregion
|
||||
|
||||
#region IReadOnlyList implementation
|
||||
public int Count { get { return list.Count; } }
|
||||
public int Count => list.Count;
|
||||
|
||||
public T this[int index] => list[index];
|
||||
|
||||
public T this[int index] { get { return list[index]; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,18 +58,18 @@ namespace OpenRA.Primitives
|
||||
Height = size.Height;
|
||||
}
|
||||
|
||||
public int Left { get { return X; } }
|
||||
public int Right { get { return X + Width; } }
|
||||
public int Top { get { return Y; } }
|
||||
public int Bottom { get { return Y + Height; } }
|
||||
public bool IsEmpty { get { return X == 0 && Y == 0 && Width == 0 && Height == 0; } }
|
||||
public int2 Location { get { return new int2(X, Y); } }
|
||||
public Size Size { get { return new Size(Width, Height); } }
|
||||
public int Left => X;
|
||||
public int Right => X + Width;
|
||||
public int Top => Y;
|
||||
public int Bottom => Y + Height;
|
||||
public bool IsEmpty => X == 0 && Y == 0 && Width == 0 && Height == 0;
|
||||
public int2 Location => new int2(X, Y);
|
||||
public Size Size => new Size(Width, Height);
|
||||
|
||||
public int2 TopLeft { get { return Location; } }
|
||||
public int2 TopRight { get { return new int2(X + Width, Y); } }
|
||||
public int2 BottomLeft { get { return new int2(X, Y + Height); } }
|
||||
public int2 BottomRight { get { return new int2(X + Width, Y + Height); } }
|
||||
public int2 TopLeft => Location;
|
||||
public int2 TopRight => new int2(X + Width, Y);
|
||||
public int2 BottomLeft => new int2(X, Y + Height);
|
||||
public int2 BottomRight => new int2(X + Width, Y + Height);
|
||||
|
||||
public bool Contains(int x, int y)
|
||||
{
|
||||
|
||||
@@ -48,15 +48,16 @@ namespace OpenRA.Primitives
|
||||
stream.Seek(BaseOffset, SeekOrigin.Begin);
|
||||
}
|
||||
|
||||
public override bool CanSeek { get { return true; } }
|
||||
public override bool CanRead { get { return BaseStream.CanRead; } }
|
||||
public override bool CanWrite { get { return BaseStream.CanWrite; } }
|
||||
public override bool CanSeek => true;
|
||||
public override bool CanRead => BaseStream.CanRead;
|
||||
public override bool CanWrite => BaseStream.CanWrite;
|
||||
|
||||
public override long Length => BaseCount;
|
||||
|
||||
public override long Length { get { return BaseCount; } }
|
||||
public override long Position
|
||||
{
|
||||
get { return BaseStream.Position - BaseOffset; }
|
||||
set { BaseStream.Position = BaseOffset + value; }
|
||||
get => BaseStream.Position - BaseOffset;
|
||||
set => BaseStream.Position = BaseOffset + value;
|
||||
}
|
||||
|
||||
public override int ReadByte()
|
||||
@@ -105,18 +106,18 @@ namespace OpenRA.Primitives
|
||||
|
||||
public override void SetLength(long value) { throw new NotSupportedException(); }
|
||||
|
||||
public override bool CanTimeout { get { return BaseStream.CanTimeout; } }
|
||||
public override bool CanTimeout => BaseStream.CanTimeout;
|
||||
|
||||
public override int ReadTimeout
|
||||
{
|
||||
get { return BaseStream.ReadTimeout; }
|
||||
set { BaseStream.ReadTimeout = value; }
|
||||
get => BaseStream.ReadTimeout;
|
||||
set => BaseStream.ReadTimeout = value;
|
||||
}
|
||||
|
||||
public override int WriteTimeout
|
||||
{
|
||||
get { return BaseStream.WriteTimeout; }
|
||||
set { BaseStream.WriteTimeout = value; }
|
||||
get => BaseStream.WriteTimeout;
|
||||
set => BaseStream.WriteTimeout = value;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Primitives
|
||||
Height = height;
|
||||
}
|
||||
|
||||
public bool IsEmpty { get { return Width == 0 && Height == 0; } }
|
||||
public bool IsEmpty => Width == 0 && Height == 0;
|
||||
|
||||
public bool Equals(Size other)
|
||||
{
|
||||
|
||||
@@ -135,8 +135,8 @@ namespace OpenRA.Primitives
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Rectangle> ItemBounds { get { return itemBounds.Values; } }
|
||||
public IEnumerable<Rectangle> ItemBounds => itemBounds.Values;
|
||||
|
||||
public IEnumerable<T> Items { get { return itemBounds.Keys; } }
|
||||
public IEnumerable<T> Items => itemBounds.Keys;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ namespace OpenRA
|
||||
public static float2 Max(float2 a, float2 b) { return new float2(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); }
|
||||
public static float2 Min(float2 a, float2 b) { return new float2(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); }
|
||||
|
||||
public float LengthSquared { get { return X * X + Y * Y; } }
|
||||
public float Length { get { return (float)Math.Sqrt(LengthSquared); } }
|
||||
public float LengthSquared => X * X + Y * Y;
|
||||
public float Length => (float)Math.Sqrt(LengthSquared);
|
||||
}
|
||||
|
||||
public class EWMA
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA
|
||||
public readonly struct float3 : IEquatable<float3>
|
||||
{
|
||||
public readonly float X, Y, Z;
|
||||
public float2 XY { get { return new float2(X, Y); } }
|
||||
public float2 XY => new float2(X, Y);
|
||||
|
||||
public float3(float x, float y, float z) { X = x; Y = y; Z = z; }
|
||||
public float3(float2 xy, float z) { X = xy.X; Y = xy.Y; Z = z; }
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace OpenRA
|
||||
|
||||
public int2 Sign() { return new int2(Math.Sign(X), Math.Sign(Y)); }
|
||||
public int2 Abs() { return new int2(Math.Abs(X), Math.Abs(Y)); }
|
||||
public int LengthSquared { get { return X * X + Y * Y; } }
|
||||
public int Length { get { return Exts.ISqrt(LengthSquared); } }
|
||||
public int LengthSquared => X * X + Y * Y;
|
||||
public int Length => Exts.ISqrt(LengthSquared);
|
||||
|
||||
public int2 WithX(int newX)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user