Exemplo n.º 1
0
  public void shuffle() {
    ArrayList<ICard> shuffled = new ArrayList<ICard>(INITIAL_DECK_SIZE);

    for (int i = 0; i < this.deck.size(); i++) {
      // draw a card with random index and it add it to the shuffled array
      shuffled.add(this.draw(false, util.Util.random(0, this.deck.size())));
    }

    this.deck = shuffled;
  }