Package game

Interface GameApi


public interface GameApi
  • Method Details

    • createGame

      UUID createGame(String username, int numberOfPlayers, int expectedScore, GameMode gameMode)
      create a game and username is one of the players
      Parameters:
      username - of the player who has created the game
      Returns:
      the id of the Game (modeled with a Verticle)
    • joinGame

      boolean joinGame(String username, int idGame)
      the username join the specif game
      Parameters:
      username - of the player who has created the game
      idGame - of the game the user wants to join
      Returns:
      true if success
    • playCard

      boolean playCard(int idGame, Card<CardValue,CardSuit> card, String username)
      the username played a card
      Parameters:
      idGame - of the game the user wants to join
      card - played by the user
      username - user who played the card
      Returns:
    • canStart

      boolean canStart(int idGame)
      Parameters:
      idGame - the game to check
      Returns:
      true if all players have joined the game
    • chooseSuit

      void chooseSuit(int idGame, CardSuit suit)
      Parameters:
      idGame - the specific game
      suit - the suit choosen by the first player
    • startNewRound

      void startNewRound(int idGame)
      Parameters:
      idGame - the specific game reset the leading suit in order to start a new round