示例#1
0
string Eximo::toPrologString() {
	stringstream ss;

	// board
	ss << "[[";
	for (unsigned i = 0; i < eximoGame->board.size(); i++) {
		if (i != 0)
			ss << ",";
		ss << "[";

		for (unsigned j = 0; j < eximoGame->board[i].size(); j++) {
			if (j != 0)
				ss << ",";

			ss << cellToString(eximoGame->board[i][j]);
		}

		ss << "]";
	}
	ss << "],";

	// number of pieces of each player
	ss << "[" << eximoGame->numPlayerPieces.first << ","
			<< eximoGame->numPlayerPieces.second << "],";

	// current player turn
	ss << playerToString(eximoGame->currentPlayer) << ",";

	// game mode
	ss << gameModeToString(eximoGame->gameMode) << "]";

	return ss.str();
}
示例#2
0
string Eximo::toString() {
	stringstream ss;

	ss << "---- Eximo.toString() ----------------------" << endl;

	ss << "Board:" << endl;
	for (unsigned i = 0; i < eximoGame->board.size(); i++) {
		for (unsigned j = 0; j < eximoGame->board[i].size(); j++) {
			if (j != 0)
				ss << " ";

			ss << eximoGame->board[i][j];
		}

		ss << endl;
	}

	ss << "Player pieces: " << eximoGame->numPlayerPieces.first << " - "
			<< eximoGame->numPlayerPieces.second << endl;

	ss << "Current player turn: " << playerToString(eximoGame->currentPlayer)
			<< endl;

	ss << "Game mode: " << gameModeToString(eximoGame->gameMode) << endl;

	ss << "--------------------------------------------" << endl;

	return ss.str();
}
示例#3
0
string Eximo::getCurrentPlayer() {
	return playerToString(eximoGame->currentPlayer);
}
示例#4
0
文件: Rook.cpp 项目: liuchbryan/Chess
string Rook::toString () {
  
  string name (playerToString());
  name.append(" Rook");
  return name;  
}