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(); }
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(); }
string Eximo::getCurrentPlayer() { return playerToString(eximoGame->currentPlayer); }
string Rook::toString () { string name (playerToString()); name.append(" Rook"); return name; }