Package BLManagment

Class BusinessLogicController

java.lang.Object
BLManagment.BusinessLogicController

public class BusinessLogicController extends Object
  • Constructor Details

    • BusinessLogicController

      public BusinessLogicController(io.vertx.core.Vertx vertx, GameService gameService, int port, String host)
  • Method Details

    • getShuffledDeck

      public CompletableFuture<io.vertx.core.json.JsonObject> getShuffledDeck(UUID gameID, Integer numberOfPlayers)
      Parameters:
      numberOfPlayers -
      Returns:
    • startRound

      public void startRound()
    • trickCompleted

      public void trickCompleted()
      perform all the actions the system needs to do when a trick is completed. There's also post request to business logic in order to compute the score, get the winning team and position
    • computeScore

      public CompletableFuture<io.vertx.core.json.JsonObject> computeScore(int[] cards, int[] teamACards, Map<String,String> users, String trump, String mode, List<Boolean> isSuitFinishedList, UUID gameID, int turn)
    • checkMaraffa

      public void checkMaraffa()
    • getMaraffa

      public CompletableFuture<io.vertx.core.json.JsonObject> getMaraffa(int[] deck, int suit, int value, int trump)
      This Java method asynchronously sends a POST request with a JSON object to a specified endpoint and returns a CompletableFuture containing the response JsonObject or an error message.
      Parameters:
      deck - The `deck` parameter is an array of integers representing a deck of cards. Each integer value in the array corresponds to a specific card in the deck.
      suit - The `suit` parameter in the `getMaraffa` method represents the suit of the cards in the deck that you want to check for Maraffa. It is an integer value that typically corresponds to a specific suit in a standard deck of playing cards (e.g., Hearts, Diamonds,
    • checkPlayCard

      public void checkPlayCard()
    • validatePlayCard

      public CompletableFuture<io.vertx.core.json.JsonObject> validatePlayCard(int[] trick, int card, int[] userCards, boolean cardIsTrump)