Change ComboColours type to IReadOnlyList<Color4>

Also exposes functions to modify the internal list (AddComboColours, ClearComboColours)
This commit is contained in:
iiSaLMaN
2019-11-07 15:54:30 +03:00
parent 41515e9e6c
commit 808543885f
8 changed files with 36 additions and 21 deletions

View File

@ -2,6 +2,8 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Beatmaps.Formats;
using osuTK.Graphics;
@ -26,7 +28,7 @@ namespace osu.Game.Skinning
private List<Color4> comboColours = new List<Color4>();
public List<Color4> ComboColours
public IReadOnlyList<Color4> ComboColours
{
get
{
@ -38,9 +40,13 @@ namespace osu.Game.Skinning
return null;
}
set => comboColours = value;
set => comboColours = value.ToList();
}
public void AddComboColours(params Color4[] colours) => colours.ForEach(c => comboColours.Add(c));
public void ClearComboColours() => comboColours.Clear();
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
public readonly Dictionary<string, string> ConfigDictionary = new Dictionary<string, string>();