Exemplo n.º 1
0
        public virtual void PreProcess()
        {
            IHasComboInformation lastObj = null;

            bool isFirst = true;

            foreach (var obj in Beatmap.HitObjects.OfType <IHasComboInformation>())
            {
                if (isFirst)
                {
                    obj.NewCombo = true;

                    // first hitobject should always be marked as a new combo for sanity.
                    isFirst = false;
                }

                if (obj.NewCombo)
                {
                    obj.IndexInCurrentCombo = 0;
                    obj.ComboIndex          = (lastObj?.ComboIndex ?? 0) + obj.ComboOffset + 1;

                    if (lastObj != null)
                    {
                        lastObj.LastInCombo = true;
                    }
                }
                else if (lastObj != null)
                {
                    obj.IndexInCurrentCombo = lastObj.IndexInCurrentCombo + 1;
                    obj.ComboIndex          = lastObj.ComboIndex;
                }

                lastObj = obj;
            }
        }
        public virtual void PreProcess()
        {
            IHasComboInformation lastObj = null;

            foreach (var obj in Beatmap.HitObjects.OfType <IHasComboInformation>())
            {
                if (obj.NewCombo)
                {
                    obj.IndexInCurrentCombo = 0;
                    obj.ComboIndex          = (lastObj?.ComboIndex ?? 0) + obj.ComboOffset + 1;

                    if (lastObj != null)
                    {
                        lastObj.LastInCombo = true;
                    }
                }
                else if (lastObj != null)
                {
                    obj.IndexInCurrentCombo = lastObj.IndexInCurrentCombo + 1;
                    obj.ComboIndex          = lastObj.ComboIndex;
                }

                lastObj = obj;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Post-processes a Beatmap to add mode-specific components that aren't added during conversion.
        /// <para>
        /// An example of such a usage is for combo colours.
        /// </para>
        /// </summary>
        /// <param name="beatmap">The Beatmap to process.</param>
        public virtual void PostProcess(Beatmap <TObject> beatmap)
        {
            IHasComboInformation lastObj = null;

            foreach (var obj in beatmap.HitObjects.OfType <IHasComboInformation>())
            {
                if (obj.NewCombo)
                {
                    obj.IndexInCurrentCombo = 0;
                    if (lastObj != null)
                    {
                        lastObj.LastInCombo = true;
                        obj.ComboIndex      = lastObj.ComboIndex + 1;
                    }
                }
                else if (lastObj != null)
                {
                    obj.IndexInCurrentCombo = lastObj.IndexInCurrentCombo + 1;
                    obj.ComboIndex          = lastObj.ComboIndex;
                }

                lastObj = obj;
            }
        }
Exemplo n.º 4
0
 protected override IBindable <Color4> GetComboColour(IHasComboColours source, int comboIndex, IHasComboInformation combo)
 => base.GetComboColour(source, combo.ComboIndexWithOffsets, combo);
Exemplo n.º 5
0
 public SkinComboColourLookup(int colourIndex, IHasComboInformation combo)
 {
     ColourIndex = colourIndex;
     Combo       = combo;
 }
Exemplo n.º 6
0
        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);
        }