/// <summary> /// Ask for the game parameter /// </summary> /// <param name="father"> Father window</param> /// <returns> /// true if succeed /// </returns> public static bool AskGameParameter(MainWindow father) { bool bRetVal; frmGameParameter frm; frm = new frmGameParameter(father); frm.Owner = father; bRetVal = (frm.ShowDialog() == true); return(bRetVal); }
/// <summary> /// Ask for the game parameter /// </summary> /// <param name="parent"> Parent window</param> /// <param name="settingSearchMode"> Search mode</param> /// <returns> /// true if succeed /// </returns> public static bool AskGameParameter(MainWindow parent, SettingSearchMode settingSearchMode) { bool bRetVal; frmGameParameter frm; frm = new frmGameParameter(parent, settingSearchMode); frm.Owner = parent; bRetVal = (frm.ShowDialog() == true); if (bRetVal) { if (frm.radioButtonLevel1.IsChecked == true) { settingSearchMode.DifficultyLevel = SettingSearchMode.DifficultyLevelE.VeryEasy; } else if (frm.radioButtonLevel2.IsChecked == true) { settingSearchMode.DifficultyLevel = SettingSearchMode.DifficultyLevelE.Easy; } else if (frm.radioButtonLevel3.IsChecked == true) { settingSearchMode.DifficultyLevel = SettingSearchMode.DifficultyLevelE.Intermediate; } else if (frm.radioButtonLevel4.IsChecked == true) { settingSearchMode.DifficultyLevel = SettingSearchMode.DifficultyLevelE.Hard; } else if (frm.radioButtonLevel5.IsChecked == true) { settingSearchMode.DifficultyLevel = SettingSearchMode.DifficultyLevelE.VeryHard; } else if (frm.radioButtonLevelManual.IsChecked == true) { settingSearchMode.DifficultyLevel = SettingSearchMode.DifficultyLevelE.Manual; } frm.ParentWindow.m_chessCtl.SearchMode = settingSearchMode.GetSearchMode(); } return(bRetVal); }