コード例 #1
0
ファイル: Game.java プロジェクト: MiranBatti/KasinoProjekt
  /**
   * Every player sould take four cards when the game begins.
   *
   * @return ArrayList<Card>
   */
  private ArrayList<Card> takeFourCards() {
    ArrayList<Card> cardsToDeal = new ArrayList<Card>();

    if (deck.amountOfCards() >= 4) {
      for (int i = 0; i < 4; i++) {
        cardsToDeal.add(deck.getCards().get(i));
      }
      deck.getCards().removeAll(cardsToDeal);
    }
    return cardsToDeal;
  }
コード例 #2
0
ファイル: Game.java プロジェクト: MiranBatti/KasinoProjekt
 /**
  * Returns amount of cards in deck.
  *
  * @return int
  */
 public int getDeckAmountCards() {
   return deck.amountOfCards();
 }