Implement missing output operator

This commit is contained in:
Maximilian Keßler 2023-11-24 16:11:36 +01:00
parent 934345e076
commit c7eac217a8
Signed by: max
GPG key ID: BCC5A619923C0BA5
2 changed files with 31 additions and 0 deletions

View file

@ -102,6 +102,8 @@ namespace Hanabi
std::ostream & operator<<(std::ostream & os, const Action & action);
std::ostream & operator<<(std::ostream & os, const ActionType & action_type);
namespace Cards
{

View file

@ -21,6 +21,35 @@ namespace Hanabi
return os;
}
std::ostream & operator<<(std::ostream & os, ActionType const & action_type)
{
switch (action_type)
{
case ActionType::play:
os << "play";
break;
case ActionType::discard:
os << "discard";
break;
case ActionType::color_clue:
os << "clue color";
break;
case ActionType::rank_clue:
os << "clue rank";
break;
case ActionType::end_game:
os << "end game";
break;
case ActionType::vote_terminate_players:
os << "vote termination";
break;
case ActionType::vote_terminate:
os << "terminate game";
break;
}
return os;
}
std::string to_string(const Hanabi::Card & card)
{