Implement missing output operator
This commit is contained in:
parent
934345e076
commit
c7eac217a8
2 changed files with 31 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue