mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-29 00:41:38 +02:00
- Refactored victory loss condition checks
- Added toString() method to EVictoryLossCheckResult enum class to improve debugging - Removed mostly unused CFunctionList2 - Added missing header files for vcmiclient project to CMakeLists - Tweaked SDL suggests bpp message a bit - Added showInfoDialogAndWait (info dialog and waits, used from client thread) and showOkDialog (callback to ok click, used from GUI thread) to player interface - Added showOkDialog method to CInfoWindow (unused for now, but may be used later)
This commit is contained in:
@ -3327,15 +3327,19 @@ bool EVictoryLossCheckResult::loss() const
|
||||
return !victory();
|
||||
}
|
||||
|
||||
std::string EVictoryLossCheckResult::toString() const
|
||||
{
|
||||
if(*this == EVictoryLossCheckResult::NO_VICTORY_OR_LOSS) return "No victory or loss";
|
||||
else if(*this == EVictoryLossCheckResult::VICTORY_STANDARD) return "Victory standard";
|
||||
else if(*this == EVictoryLossCheckResult::VICTORY_SPECIAL) return "Victory special";
|
||||
else if(*this == EVictoryLossCheckResult::LOSS_STANDARD_HEROES_AND_TOWNS) return "Loss standard heroes and towns";
|
||||
else if(*this == EVictoryLossCheckResult::LOSS_STANDARD_TOWNS_AND_TIME_OVER) return "Loss standard towns and time over";
|
||||
else if(*this == EVictoryLossCheckResult::LOSS_SPECIAL) return "Loss special";
|
||||
else return "Unknown type";
|
||||
}
|
||||
|
||||
std::ostream & operator<<(std::ostream & os, const EVictoryLossCheckResult & victoryLossCheckResult)
|
||||
{
|
||||
if(victoryLossCheckResult == EVictoryLossCheckResult::NO_VICTORY_OR_LOSS) os << "No victory or loss";
|
||||
else if(victoryLossCheckResult == EVictoryLossCheckResult::VICTORY_STANDARD) os << "Victory standard";
|
||||
else if(victoryLossCheckResult == EVictoryLossCheckResult::VICTORY_SPECIAL) os << "Victory special";
|
||||
else if(victoryLossCheckResult == EVictoryLossCheckResult::LOSS_STANDARD_HEROES_AND_TOWNS) os << "Loss standard heroes and towns";
|
||||
else if(victoryLossCheckResult == EVictoryLossCheckResult::LOSS_STANDARD_TOWNS_AND_TIME_OVER) os << "Loss standard towns and time over";
|
||||
else if(victoryLossCheckResult == EVictoryLossCheckResult::LOSS_SPECIAL) os << "Loss special";
|
||||
else os << "Unknown type";
|
||||
|
||||
os << victoryLossCheckResult.toString();
|
||||
return os;
|
||||
}
|
||||
|
Reference in New Issue
Block a user