Example #1
0
 def play_round(self, request):
     """Plays a round. Returns a game state"""
     return GameHandler.play_round(request)
Example #2
0
 def get_game(self, request):
     """Return the current game state."""
     return GameHandler.get_game(request)
Example #3
0
 def new_game(self, request):
     """Creates a new Rock-Paper-Scissors game"""
     return GameHandler.new_game(request)
Example #4
0
 def get_game_history(self, request):
     """Returns the round-by-round result of an active or completed Game."""
     return GameHandler.get_game_history(request)
Example #5
0
 def cancel_game(self, request):
     """Cancels an active game. The game must belong to current user."""
     GameHandler.cancel_game(request)
     return StringMessage(message='The game has been successfully cancelled!')
Example #6
0
 def get_user_games(self, request):
     """Returns all of the currently authenticated User's games"""
     return GameHandler.get_user_games()