WPF/MainWindow.xaml.cs
/// <summary>
/// Load application settings from user data
/// </summary>
Load application settings from user data
Load application settings from user data
private void LoadSettings()
        {
            BestNames = new Dictionary<GameDifficulty, string>()
            {
                { GameDifficulty.Beginner, Settings.Default.Name0 },
                { GameDifficulty.Advanced, Settings.Default.Name1 },
                { GameDifficulty.Expert,   Settings.Default.Name2 }
            };
            BestTimes = new Dictionary<GameDifficulty, int>()
            {
                { GameDifficulty.Beginner, Settings.Default.Time0 },
                { GameDifficulty.Advanced, Settings.Default.Time1 },
                { GameDifficulty.Expert,   Settings.Default.Time2 }
            };
            ctrlGameBoard.Board.MarkQuestion = Settings.Default.MarkQuestion;
            if (Settings.Default.Difficulty == GameDifficulty.Custom)
            {
                ctrlGameBoard.Board.NewGame(Settings.Default.Columns, Settings.Default.Rows, Settings.Default.Mines);
            }
            else
            {
                ctrlGameBoard.Board.NewGame(Settings.Default.Difficulty);
            }
        }
private void LoadSettings ( ) { BestNames = new Dictionary < GameDifficulty , string > ( ) { { GameDifficulty . Beginner , Settings . Default . Name0 } , { GameDifficulty . Advanced , Settings . Default . Name1 } , { GameDifficulty . Expert , Settings . Default . Name2 } } ; BestTimes = new Dictionary < GameDifficulty , int > ( ) { { GameDifficulty . Beginner , Settings . Default . Time0 } , { GameDifficulty . Advanced , Settings . Default . Time1 } , { GameDifficulty . Expert , Settings . Default . Time2 } } ; ctrlGameBoard . Board . MarkQuestion = Settings . Default . MarkQuestion ; if ( Settings . Default . Difficulty == GameDifficulty . Custom ) { ctrlGameBoard . Board . NewGame ( Settings . Default . Columns , Settings . Default . Rows , Settings . Default . Mines ) ; } else { ctrlGameBoard . Board . NewGame ( Settings . Default . Difficulty ) ; } }
Load application settings from user data
Load application settings from user data
// Initialize the fastest times data // Initialize mark question menu, to enable question mark // while playing the game // Start new game based on difficulty