예제 #1
0
        /// <summary>
        /// Merge cell example.
        /// </summary>
        void MergeCell(Cell cell1)
        {
            if (lastCell != null)
            {
                neighbours = grid.CellGetNeighbours(cell1);
                if (neighbours.Contains(lastCell))
                {
                    grid.CellMerge(lastCell, cell1);
                    cellNoString = "Cells merged!";
                }
                else
                {
                    cellNoString = "Cell is not a neighbour!";
                }
                lastCell = null;
            }
            else
            {
                lastCell     = cell1;
                cellNoString = "Now, click on a second cell to merge it.";
            }

            grid.Redraw();
        }