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); }
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); }