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(); }
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); }
public void notifyPlayedCard(Card card, Player playerWhoPlayed, Player currentPlayer) { endpoint.send( new PlayedCardDto(card, PlayerDto.from(playerWhoPlayed), PlayerDto.from(currentPlayer))); }