Exemplo n.º 1
0
 public void gameOver(Player winner, List<Player> players) {
   GameOverDto dto =
       new GameOverDto(
           PlayerDto.from(winner),
           players.stream().map(PlayerDto::from).collect(Collectors.toList()));
   endpoint.send(dto);
   currentHand = Optional.empty();
 }
Exemplo n.º 2
0
  public void playHand(Hand hand, LinkedList<Player> players, Player startingPlayer) {
    currentHand = Optional.of(hand);
    lostTricks = new LostTricks();

    players = putCurrentPlayerFirst(players);

    HandDto dto =
        new HandDto(
            players.stream().map(PlayerDto::from).collect(Collectors.toList()),
            PlayerDto.from(startingPlayer),
            playerHand,
            id);
    endpoint.send(dto);
  }
Exemplo n.º 3
0
 public void notifyPlayedCard(Card card, Player playerWhoPlayed, Player currentPlayer) {
   endpoint.send(
       new PlayedCardDto(card, PlayerDto.from(playerWhoPlayed), PlayerDto.from(currentPlayer)));
 }