1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:13:20 +08:00

Fix formatting

This commit is contained in:
Craftplacer 2020-08-23 15:23:10 +02:00
parent e6646b9877
commit 492be0e016
3 changed files with 9 additions and 12 deletions

View File

@ -45,12 +45,10 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.IsTrue(decoded.beatmapSkin.Configuration.Equals(decodedAfterEncode.beatmapSkin.Configuration)); Assert.IsTrue(decoded.beatmapSkin.Configuration.Equals(decodedAfterEncode.beatmapSkin.Configuration));
} }
private void sort((IBeatmap, LegacyBeatmapSkin) bs) private void sort((IBeatmap beatmap, LegacyBeatmapSkin beatmapSkin) tuple)
{ {
var (beatmap, beatmapSkin) = bs;
// Sort control points to ensure a sane ordering, as they may be parsed in different orders. This works because each group contains only uniquely-typed control points. // Sort control points to ensure a sane ordering, as they may be parsed in different orders. This works because each group contains only uniquely-typed control points.
foreach (var g in beatmap.ControlPointInfo.Groups) foreach (var g in tuple.beatmap.ControlPointInfo.Groups)
{ {
ArrayList.Adapter((IList)g.ControlPoints).Sort( ArrayList.Adapter((IList)g.ControlPoints).Sort(
Comparer<ControlPoint>.Create((c1, c2) => string.Compare(c1.GetType().ToString(), c2.GetType().ToString(), StringComparison.Ordinal))); Comparer<ControlPoint>.Create((c1, c2) => string.Compare(c1.GetType().ToString(), c2.GetType().ToString(), StringComparison.Ordinal)));
@ -67,7 +65,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
new BeatmapSetFileInfo new BeatmapSetFileInfo
{ {
Filename = name, Filename = name,
FileInfo = new osu.Game.IO.FileInfo() { Hash = name } FileInfo = new osu.Game.IO.FileInfo { Hash = name }
} }
}; };

View File

@ -23,7 +23,7 @@ namespace osu.Game.Skinning
public readonly int Keys; public readonly int Keys;
public IDictionary<string, Color4> CustomColours { get; set; } = new SortedDictionary<string, Color4>(); public IDictionary<string, Color4> CustomColours { get; } = new SortedDictionary<string, Color4>();
public Dictionary<string, string> ImageLookups = new Dictionary<string, string>(); public Dictionary<string, string> ImageLookups = new Dictionary<string, string>();

View File

@ -47,14 +47,13 @@ namespace osu.Game.Skinning
public void AddComboColours(params Color4[] colours) => comboColours.AddRange(colours); public void AddComboColours(params Color4[] colours) => comboColours.AddRange(colours);
public IDictionary<string, Color4> CustomColours { get; set; } = new SortedDictionary<string, Color4>(); public IDictionary<string, Color4> CustomColours { get; } = new SortedDictionary<string, Color4>();
public readonly SortedDictionary<string, string> ConfigDictionary = new SortedDictionary<string, string>(); public readonly SortedDictionary<string, string> ConfigDictionary = new SortedDictionary<string, string>();
public bool Equals(SkinConfiguration other) public bool Equals(SkinConfiguration other) => other != null
=> other != null && ConfigDictionary.SequenceEqual(other.ConfigDictionary)
&& ConfigDictionary.SequenceEqual(other.ConfigDictionary) && ComboColours.SequenceEqual(other.ComboColours)
&& ComboColours.SequenceEqual(other.ComboColours) && CustomColours?.SequenceEqual(other.CustomColours) == true;
&& CustomColours?.SequenceEqual(other.CustomColours) == true;
} }
} }