Exemplo n.º 1
0
        private void UpdateGameState()
        {
            bool isWin = true;

            for (int r = 0; r < CurrentLevel.RowCount; r++)
            {
                for (int c = 0; c < CurrentLevel.ColCount; c++)
                {
                    CubiconCell cell = CurrentLevel[r, c];

                    if (IsCellMovable(cell) && !HasCellMovableNeighbor(cell))
                    {
                        isWin = false;
                    }
                }
            }

            if (isWin)
            {
                state = CubiconGameState.WIN;
            }
        }
Exemplo n.º 2
0
        public void NewGame(CubiconLevels level)
        {
            CurrentLevel = level;

            state = CubiconGameState.PLAYING;
        }