+
+ red->FixName(); blue->FixName();
+
+}
+
+string itostr(int i)
+{
+ stringstream s;
+ s << i;
+ return s.str();
+}
+
+
+void Game::PrintResults(const MovementResult & result, string & buffer)
+{
+ stringstream s("");
+ switch (Game::theGame->Turn())
+ {
+ case Piece::RED:
+ s << Game::theGame->red->name << " RED ";
+ break;
+ case Piece::BLUE:
+ s << Game::theGame->blue->name << " BLUE ";
+ break;
+ case Piece::BOTH:
+ s << "neither BOTH ";
+ break;
+ case Piece::NONE:
+ s << "neither NONE ";
+ break;
+ }
+
+ if (!Board::LegalResult(result) && result != MovementResult::BAD_SETUP)
+ s << "ILLEGAL ";
+ else if (!Board::HaltResult(result))
+ s << "INTERNAL_ERROR ";
+ else
+ {
+ switch (result.type)
+ {
+ case MovementResult::VICTORY_FLAG:
+ case MovementResult::VICTORY_ATTRITION: //It does not matter how you win, it just matters that you won!
+ s << "VICTORY ";
+ break;
+ case MovementResult::SURRENDER:
+ s << "SURRENDER ";
+ break;
+ case MovementResult::DRAW:
+ s << "DRAW ";
+ break;
+ case MovementResult::DRAW_DEFAULT:
+ s << "DRAW_DEFAULT ";
+ break;
+ case MovementResult::BAD_SETUP:
+ s << "BAD_SETUP ";
+ break;
+ default:
+ s << "INTERNAL_ERROR ";
+ break;
+ }
+ }