Package game
Interface GameApi
public interface GameApi
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanStart(int idGame) voidchooseSuit(int idGame, CardSuit suit) createGame(String username, int numberOfPlayers, int expectedScore, GameMode gameMode) create a game and username is one of the playersbooleanthe username join the specif gamebooleanthe username played a cardvoidstartNewRound(int idGame)
-
Method Details
-
createGame
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
the username join the specif game- Parameters:
username- of the player who has created the gameidGame- of the game the user wants to join- Returns:
- true if success
-
playCard
the username played a card- Parameters:
idGame- of the game the user wants to joincard- played by the userusername- 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
- Parameters:
idGame- the specific gamesuit- 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
-