Ejemplo n.º 1
0
    public bool Activate(GridModel grid, [CanBeNull] int indexCell, [CanBeNull] GridModel newGrid = null, [CanBeNull] GridController gridController = null)
    {
        base.Activate(grid, indexCell);

        List <CellModel> tempGridIndex = new List <CellModel>();

        for (int i = 0; i < grid.Grid.Count; i++)
        {
            if (grid.Grid[i].Value > 0)
            {
                tempGridIndex.Add(grid.Grid[i]);
            }
        }

        for (int i = 0; i < tempGridIndex.Count; i++)
        {
            for (int j = i + 1; j < tempGridIndex.Count; j++)
            {
                if (grid.CalculateWithoutDelete(tempGridIndex[i].CurrentIndex, tempGridIndex[j].CurrentIndex))
                {
                    tempGridIndex[i].GetView().Activate();
                    tempGridIndex[j].GetView().Activate();
                    return(true);
                }
            }
        }

        return(false);
    }