Пример #1
0
        public HighscoresPage()
        {
            this.InitializeComponent();
            SodukoGameInfo sgi = new SodukoGameInfo();

            sgi = Serilizer.GetPersistingSodukoGameInfo();

            SetHighscores(sgi.Entries);

            // Set all of the time played data in the UI.
            TimesPlayedData.UpdateUI(TotalTimesPlayedTextBlock, EasyTimesPlayedTextBlock, NormalTimesPlayedTextBlock, HardTimesPlayedTextBlock);

            SetPageData();
        }
Пример #2
0
        private async void InitPuzzle()
        {
            _hasSaved = false;
            try
            {
                _puzzle = new SodukoPuzzle(9, PuzzleCanvas, HintMode.Adjacent);
                _puzzle.OnCompletedGame += OnGameCompleted;
            }
            catch (ArgumentException e)
            {
                // Do nothing...
                string failureMessage = e.Message;
            }

            _puzzle.ShowNumberSelector += OnObjectTapped;

            if (_sii.RestoreState)
            {
                if (Serilizer.IsStateSaved())
                {
                    LoadData();
                }
            }
            else
            {
                _difficulty = _sii.DesiredDifficulty;
                if (!_puzzle.InitPuzzle(_difficulty))
                {
                    MessageDialog dlg = new MessageDialog("Couldn't init the puzzle!", "Failure");
                    await dlg.ShowAsync();
                }
            }
            // The highscore is completely different and is always saved.
            _gameInfo = Serilizer.GetPersistingSodukoGameInfo();

            _expMgr.LoadData();


            DisplayHighScore();
            SetDifficulty(_difficulty);
            ShowNumberSelector();
            StartTimer(true);
            HintModeComboBox.SelectedItem = AdjacentComboBoxItem;
        }