Example #1
0
        // Reset the game board and all player status
        public void Reset()
        {
            m_MovesHistory.Clear();
            m_RedoMovesHistory.Clear();

            // Reset player timers
            m_WhitePlayer.ResetTime();
            m_BlackPlayer.ResetTime();

            GameTurn = Side.SideType.White;          // In chess first turn is always of white
            m_WhitePlayer.TimeStart();               // Player time starts
            Board.Init(this.AbideByChess960RuleSet); // Initialize the board object
        }
Example #2
0
        // Reset the game board and all player status
        public void Reset(bool FisherStart = false)             //takes in a bool for randomization because this is where the board init is called from
        {
            m_MovesHistory.Clear();
            m_RedoMovesHistory.Clear();

            // Reset player timers
            m_WhitePlayer.ResetTime();
            m_BlackPlayer.ResetTime();

            GameTurn = Side.SideType.White;     // In chess first turn is always of white
            m_WhitePlayer.TimeStart();          // Player time starts
            Board.Init(FisherStart);            // Initialize the board object(with a bool to determine weather or not to randomize it)
        }
Example #3
0
        // Reset the game board and all player status
        public void Reset(string mode = "Normal")
        {
            m_MovesHistory.Clear();
            m_RedoMovesHistory.Clear();

            // Reset player timers
            m_WhitePlayer.ResetTime();
            m_BlackPlayer.ResetTime();

            GameTurn = Side.SideType.White;     // In chess first turn is always of white
            m_WhitePlayer.TimeStart();          // Player time starts
            Board.Init(mode);                   // Initialize the board object
        }
Example #4
0
        // Reset the game board and all player status
        public void Reset(bool game960 = false)
        {
            m_MovesHistory.Clear();
            m_RedoMovesHistory.Clear();

            // Reset player timers
            m_WhitePlayer.ResetTime();
            m_BlackPlayer.ResetTime();

            GameTurn = Side.SideType.White;     // In chess first turn is always of white
            m_WhitePlayer.TimeStart();          // Player time starts
            if (game960)
            {
                Board.Init960();    // Initialize the board object as a Chess960 game
            }
            else
            {
                Board.Init();                   // Initialize the board object as a normal game
            }
        }
Example #5
0
 // Set game turn for the next player
 public void NextPlayerTurn()
 {
     if (GameTurn == Side.SideType.White)
     {
         m_WhitePlayer.TimeEnd();
         m_BlackPlayer.TimeStart();              // Start player timer
         GameTurn = Side.SideType.Black;         // Set black's turn
     }
     else
     {
         m_BlackPlayer.TimeEnd();
         m_WhitePlayer.TimeStart();              // Start player timer
         GameTurn = Side.SideType.White;         // Set white's turn
     }
 }