Beispiel #1
0
void UciEngine::endGame(const Chess::Result& result)
{
	m_ignoreThinking = true;
	if (stopThinking())
		ping(false);
	ChessEngine::endGame(result);
}
Beispiel #2
0
void XboardEngine::endGame(const Chess::Result& result)
{
	State s = state();
	if (s != Thinking && s != Observing)
		return;

	if (s != Thinking)
		m_gotResult = true;

	stopThinking();
	setForceMode(true);
	write("result " + result.toVerboseString());

	ChessEngine::endGame(result);

	// If the engine can't be pinged, we may have to wait for
	// for a move or a result, or an error, or whatever. We
	// would like to extend our middle fingers to every engine
	// developer who fails to support the ping command.
	if (!m_ftPing && m_gotResult)
		finishGame();
}
Beispiel #3
0
void UciEngine::makeMove(const Chess::Move& move)
{
	if (!m_ponderMove.isNull())
	{
		if (move == m_ponderMove)
			m_ponderState = PonderHit;

		m_ponderMove = Chess::Move();
		if (m_ponderState != PonderHit)
		{
			m_moveStrings.truncate(m_moveStrings.lastIndexOf(' '));
			if (isReady())
			{
				m_ignoreThinking = true;
				if (stopThinking())
					ping(false);
			}
			else
			{
				// Cancel sending the "go ponder" message
				clearWriteBuffer();
				m_rePing = true;
			}
		}
	}

	if (m_ponderState != PonderHit)
	{
		m_ponderState = NotPondering;
		m_moveStrings += " " + board()->moveString(move, Chess::Board::LongAlgebraic);
		if (m_ignoreThinking)
			m_bmBuffer << positionString() << "isready";
		else
			sendPosition();
	}
}
Beispiel #4
0
void UciEngine::endGame(const Chess::Result& result)
{
	stopThinking();
	ChessEngine::endGame(result);
}