Example #1
0
        private bool areComboColoursEqual(IHasComboColours a, IHasComboColours b)
        {
            // equal to null, no need to SequenceEqual
            if (a.ComboColours == null && b.ComboColours == null)
            {
                return(true);
            }

            if (a.ComboColours == null || b.ComboColours == null)
            {
                return(false);
            }

            return(a.ComboColours.SequenceEqual(b.ComboColours));
        }
Example #2
0
 private static Color4 getComboColour(IHasComboColours source, int colourIndex)
 => source.ComboColours[colourIndex % source.ComboColours.Count];
Example #3
0
 protected override IBindable <Color4> GetComboColour(IHasComboColours source, int comboIndex, IHasComboInformation combo)
 => base.GetComboColour(source, combo.ComboIndexWithOffsets, combo);
        protected virtual IBindable <Color4>?GetComboColour(IHasComboColours source, int colourIndex, IHasComboInformation combo)
        {
            var colour = source.ComboColours?[colourIndex % source.ComboColours.Count];

            return(colour.HasValue ? new Bindable <Color4>(colour.Value) : null);
        }