1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

initializer lists part1

This commit is contained in:
AlexVinS
2014-10-02 19:43:46 +04:00
parent 463b9e46b3
commit 66b022f93e
20 changed files with 285 additions and 222 deletions

View File

@@ -100,23 +100,25 @@ bool PlayerColor::isValidPlayer() const
std::ostream & operator<<(std::ostream & os, const Battle::ActionType actionType)
{
static const std::map<Battle::ActionType, std::string> actionTypeToString = boost::assign::map_list_of
(Battle::END_TACTIC_PHASE, "End tactic phase")
(Battle::INVALID, "Invalid")
(Battle::NO_ACTION, "No action")
(Battle::HERO_SPELL, "Hero spell")
(Battle::WALK, "Walk")
(Battle::DEFEND, "Defend")
(Battle::RETREAT, "Retreat")
(Battle::SURRENDER, "Surrender")
(Battle::WALK_AND_ATTACK, "Walk and attack")
(Battle::SHOOT, "Shoot")
(Battle::WAIT, "Wait")
(Battle::CATAPULT, "Catapult")
(Battle::MONSTER_SPELL, "Monster spell")
(Battle::BAD_MORALE, "Bad morale")
(Battle::STACK_HEAL, "Stack heal")
(Battle::DAEMON_SUMMONING, "Daemon summoning");
static const std::map<Battle::ActionType, std::string> actionTypeToString =
{
{Battle::END_TACTIC_PHASE, "End tactic phase"},
{Battle::INVALID, "Invalid"},
{Battle::NO_ACTION, "No action"},
{Battle::HERO_SPELL, "Hero spell"},
{Battle::WALK, "Walk"},
{Battle::DEFEND, "Defend"},
{Battle::RETREAT, "Retreat"},
{Battle::SURRENDER, "Surrender"},
{Battle::WALK_AND_ATTACK, "Walk and attack"},
{Battle::SHOOT, "Shoot"},
{Battle::WAIT, "Wait"},
{Battle::CATAPULT, "Catapult"},
{Battle::MONSTER_SPELL, "Monster spell"},
{Battle::BAD_MORALE, "Bad morale"},
{Battle::STACK_HEAL, "Stack heal"},
{Battle::DAEMON_SUMMONING, "Daemon summoning"}
};
auto it = actionTypeToString.find(actionType);
if (it == actionTypeToString.end()) return os << "<Unknown type>";