Beispiel #1
0
        public void Do(BubbleField field)
        {
            _field = field;


            for (int column = _field.Size - 1; column >= 0; column--)
            {
                if (field.IsEmptyColumn(column))
                {
                    GenerateColumn(column);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Does the bubles shift.
        /// </summary>
        /// <param name="field">The field.</param>
        public void Do(BubbleField field)
        {
            _field = field;
            var shiftCounter = 0;

            for (int column = _field.Size - 1; column >= 0; column--)
            {
                if (field.IsEmptyColumn(column))
                {
                    shiftCounter++;
                }
                else if (shiftCounter > 0)
                {
                    ShiftColumn(column, shiftCounter);
                }
            }
        }