1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

- Fixed mantis #1576 (doesn't hang game)

- Implemented output stream operator<< for various classes(BattleAction, BattleHex,...) to improve debugging and logging
This commit is contained in:
beegee1
2013-11-09 16:25:20 +00:00
parent 55577d0ac4
commit e01ef8e36a
8 changed files with 66 additions and 5 deletions

View File

@ -92,3 +92,12 @@ BattleAction BattleAction::makeEndOFTacticPhase(ui8 side)
ba.actionType = END_TACTIC_PHASE;
return ba;
}
std::ostream & operator<<(std::ostream & os, const BattleAction & ba)
{
std::stringstream actionTypeStream;
actionTypeStream << ba.actionType;
return os << boost::str(boost::format("[BattleAction: side '%d', stackNumber '%d', actionType '%s', destinationTile '%s', additionalInfo '%d', selectedStack '%d']")
% static_cast<int>(ba.side) % ba.stackNumber % actionTypeStream.str() % ba.destinationTile % ba.additionalInfo % ba.selectedStack);
}