예제 #1
0
        void DeleteCell(int col, int row, int points)
        {
            var bonus = Grid[col, row] as BonusCell;

            if (bonus == null || bonus.IsEmpty)
            {
                if (Grid[col, row] == null)
                {
                    return;
                }
                Grid[col, row] = null;
                InvokeCellDeleted(col, row, points);
                // Move all cells above downwards
                MoveDown(col, row);
                MovedDown.Invoke(null, new EventArgs());
            }
            else
            {
                if (!bonus.IsNew && !bonus.IsDetonated)
                {
                    bonus.IsDetonated = true;
                    ActivatedBonus.Invoke(null, new Tuple <int, int>(bonus.Col, bonus.Row));
                }
            }
        }
예제 #2
0
 private void btnMoveDown_Click(object sender, EventArgs e)
 {
     MovedDown?.Invoke(this, null);
 }