예제 #1
0
 private void playCard(@NotNull SevensPlayer inputter, Card card, Card adjacentExtremeCard) {
   if (adjacentExtremeCard.getRank() != SEVEN) {
     extremeCards.remove(adjacentExtremeCard);
   }
   extremeCards.add(card);
   playedCards.get(card.getSuit()).add(card);
   inputter.playCard(card);
 }
예제 #2
0
 private boolean isAdjacent(Card card, Card extreme) {
   return card.getSuit() == extreme.getSuit()
       && (card.getRank().getValue() == extreme.getRank().getValue() - 1
           || card.getRank().getValue() == extreme.getRank().getValue() + 1);
 }