private async Task EndedGame()
        {
            _sudoku.Score          = _sudoku.Score + _sudoku.PointsGame;
            _sudoku.Time          += _timeSpan;
            IsGameActive           = false;
            IsGameEnded            = true;
            _sudoku.IsGameFinished = true;
            Score = _sudoku.Score;

            var message = Lives > 0? "You Win! Your Score is: " + Score: "You Lost! Your Score won't count!";

            if (Lives > 0)
            {
                await _masterOfSudokuStore.UpdateMasterOfSudoku(_sudoku.Sudoku);
            }
            else
            {
                await _masterOfSudokuStore.DeleteMasterOfSudoku(_sudoku.Sudoku);
            }

            await _pageService.DisplayAlert("Finish!", message, "Back to MENU");

            await _pageService.PopAsync();
        }
Esempio n. 2
0
        private async Task DelateGame(int Id)
        {
            var sudoku = await _masterOfSudokuStore.GetMasterOfSudokusAsync();

            await _masterOfSudokuStore.DeleteMasterOfSudoku(sudoku.Single(p => p.Id == Id));
        }