Esempio n. 1
0
        public PlayViewModel(SudokuCreator.DifficultOptions difficult, PageService pageService, MasterOfSudokuViewModel sudoku)
        {
            _sudoku              = sudoku;
            Score                = _sudoku.Score;
            _pageService         = pageService;
            IsGameActive         = true;
            _difficult           = DifficultList.ListOfDifficult.Where(d => d.Name == sudoku.Sudoku.Difficult).Single().Value;
            _masterOfSudokuStore = new SQLiteMasterOfSudokuStore(DependencyService.Get <ISQLiteDb>());
            ListSolution         = new ObservableCollection <string>();
            List              = new ObservableCollection <string>();
            EndedGameCommand  = new Command(async() => await EndedGame());
            BackToManuCommand = new Command(async() => await BackToManu());
            var a  = sudoku.Board;
            var aS = sudoku.BoardSolved;

            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    if (a[i, j] == 0)
                    {
                        List.Add("");
                    }
                    if (a[i, j] != 0)
                    {
                        List.Add(a[i, j].ToString());
                    }
                    ListSolution.Add(aS[i, j].ToString());
                }
            }
            toString = "" /*SudokuCreator.ToString(aS);*/ /*SudokuCreator.ToStringCells(sudoku.Cells)*/;
        }
Esempio n. 2
0
 public StartViewModel(PageService pageService)
 {
     _pageService         = pageService;
     _masterOfSudokuStore = new SQLiteMasterOfSudokuStore(DependencyService.Get <ISQLiteDb>());
     FillDifficultList();
     StartNewGameCommand  = new Command(async() => await StartNewGame());
     FillScoreListCommand = new Command(async() => await FillScoreList());
     ResumeNewGameCommand = new Command <int>(async id => await ResumeNewGame(id));
     DeleteNewGameCommand = new Command <int>(async id => await DelateGame(id));
 }