Exemplo n.º 1
0
        public void SetPlayerToHuman(int side)
        {
            //	We can only convert InternalEngine to HumanPlayer
            if (m_player[side] == null || !(m_player[side] is InternalEngine))
            {
                throw new Exception();
            }
            InternalEngine oldPlayer = (InternalEngine)m_player[side];
            HumanPlayer    newPlayer = new HumanPlayer(oldPlayer.MessageLog, m_timerFactory);

            newPlayer.AttachGame(side, m_player[side ^ 1], Game, oldPlayer.TimeControl);
            newPlayer.MoveMade += OnMoveMade;
            newPlayer.WokeUp   += Resume;
            m_player[side]      = newPlayer;
        }
Exemplo n.º 2
0
        public void SetPlayerToInternalEngine(int side)
        {
            //	We can only convert HumanPlayer to InternalEngine
            if (m_player[side] == null || !(m_player[side] is HumanPlayer))
            {
                return;                 // throw new Exception();
            }
            HumanPlayer    oldPlayer = (HumanPlayer)m_player[side];
            InternalEngine newPlayer = new InternalEngine(oldPlayer.MessageLog, m_timerFactory);

            newPlayer.AttachGame(side, m_player[side ^ 1], Game, oldPlayer.TimeControl);
            newPlayer.MoveMade += OnMoveMade;
            m_player[side]      = newPlayer;
//			if( Game.CurrentSide == side )
//				m_player[side].Go( m_player[side] );
        }