Example #1
0
    public void Move(KeyCode direction)
    {
        switch (direction)
        {
        case KeyCode.UpArrow:
            MoveUp();
            break;

        case KeyCode.DownArrow:
            MoveDown();
            break;

        case KeyCode.RightArrow:
            MoveRight();
            break;

        case KeyCode.LeftArrow:
            MoveLeft();
            break;
        }

        //TODO: notify view with merged cells
        //_cellsView.MergeCells(_cellsModel.MergedCells);
        //TODO: empty merged cells list here not in FillEmptyCell
        //FillEmptyCell();
        //update Every CellController
        for (int i = 0; i < allCells.Length; i++)
        {
            allCells[i].MoveUpdate();
        }
        //TODO: Notify view with new Empty Cell
        //_cellsView.UpdateCells(_cellsModel.Cells4x4);
        //reset parameters as willDestroy and isNew , etc..
        _cellsModel.ResetCellsParameters();
    }