Esempio n. 1
0
        /// <summary>
        ///   Terminate the game.
        /// </summary>
        public static void TerminateGame()
        {
            WinBoard.StopListener();

            SuspendPondering();
            PlayerWhite.Brain.AbortThinking();
            PlayerBlack.Brain.AbortThinking();

            try
            {
                RegistryKey registryKeySoftware = Registry.CurrentUser.OpenSubKey("Software", true);
                if (registryKeySoftware != null)
                {
                    RegistryKey registryKeySharpChess = registryKeySoftware.CreateSubKey(@"PeterHughes.org\SharpChess");

                    if (registryKeySharpChess != null)
                    {
                        registryKeySharpChess.SetValue("FileName", saveGameFileName);
                        registryKeySharpChess.SetValue("ShowThinking", ShowThinking ? "1" : "0");
                    }
                }
            }
            catch
            {
            }
        }