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; } }
public void NewGame(CubiconLevels level) { CurrentLevel = level; state = CubiconGameState.PLAYING; }