コード例 #1
0
ファイル: Player.java プロジェクト: danpeter/hearts
 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();
 }
コード例 #2
0
ファイル: Player.java プロジェクト: danpeter/hearts
  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);
  }
コード例 #3
0
ファイル: Player.java プロジェクト: danpeter/hearts
 public void notifyPlayedCard(Card card, Player playerWhoPlayed, Player currentPlayer) {
   endpoint.send(
       new PlayedCardDto(card, PlayerDto.from(playerWhoPlayed), PlayerDto.from(currentPlayer)));
 }