private bool CheckForCommands(string user_line)
        {
            bool is_contains_command = false;

            switch (user_line.ToLower())
            {
            case "exit":
                message_buf.Push("Game Ended!");
                GameStarted         = false;
                is_contains_command = true;
                break;

            case "info":
                DisplayClass.show_program_info();
                break;

            case "save":

                is_contains_command = true;
                save_game();
                break;

            case "load":

                is_contains_command = true;
                load_game();
                Console.WriteLine("Game Loaded!");
                break;
            }
            return(is_contains_command);
        }
        public void load_game()
        {
            BinaryFormatter formatter = new BinaryFormatter();
            DirectoryInfo   info      = new DirectoryInfo(Directory.GetCurrentDirectory());

            FileInfo[] files = info.GetFiles();

            find_only_dat_files(files);
            Console.WriteLine("Games Saved:");
            DisplayClass.show_file_info(files);
            Console.WriteLine("Input game name: ");
            string name = $"{Console.ReadLine()}.dat";

            if (name.Length > 0 && find_file_name(files, name))
            {
                using (FileStream fs = new FileStream(name, FileMode.OpenOrCreate))
                {
                    try
                    {
                        board         = (BoardClass)formatter.Deserialize(fs);
                        CurrentPlayer = (Player)formatter.Deserialize(fs);
                        GameStarted   = true;
                    }
                    catch (SerializationException)
                    {
                        Console.WriteLine("LoadError!");
                    }
                }
            }
            else
            {
                Console.WriteLine("LoadError!!!");
            }
        }
 public void start_game()
 {
     if (GameStarted)
     {
         message_buf.Push($"Move of {CurrentPlayer.ToString()}");
         DisplayClass.show_table(board, message_buf);
         while (GameStarted)
         {
             game_part();
             DisplayClass.show_table(board, message_buf);
         }
     }
 }
 private void gameover(ChessClass chess)
 {
     GameStarted = false;
     DisplayClass.show_gameover_info(chess);
 }