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:
@@ -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>";
|
||||
|
||||
Reference in New Issue
Block a user