Skip to content
Snippets Groups Projects
Commit 8d16e315 authored by Bariatti Francesco's avatar Bariatti Francesco
Browse files

Won, Lost, Draw implemented

parent 2ab3336c
No related branches found
No related tags found
No related merge requests found
......@@ -50,20 +50,20 @@ namespace game
bool morpion::won(std::uint8_t player) const
{
//TODO: Implement
return false;
if (player == CROSS) return state.first_player_win;
return state.second_player_win;
}
bool morpion::lost(std::uint8_t player) const
{
//TODO: Implement
return false;
if (player == CIRCLE) return state.first_player_win;
return state.second_player_win;
}
bool morpion::draw(std::uint8_t player) const
{
//TODO: Implement
return false;
if (state.first_player_win || state.second_player_win) return false;
return state.total_moves == 9;
}
uint8_t morpion::current_player() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment