Back to project page pokerdrome.
The source code is released under:
Pokerdrome was released under the GPLv3+ (https://www.gnu.org/licenses/gpl.html) by darlose pokerengine (https://code.google.com/p/pokerengine/) was released under the Apache License 2.0 (https://www...
If you think the Android project pokerdrome listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.darlose.pokerdrome; //w ww. j ava 2s . c om /* * Copyright (c) 2005 Your Corporation. All Rights Reserved. */ import java.util.Collections; /** * User: sam * Date: Apr 2, 2005 * Time: 4:00:43 PM */ public final class Deck { private static final int DECK_SIZE = 52; private static final Cards deck; static { deck = new Cards(DECK_SIZE); for (Card.Suit suit : Card.Suit.values()) { for (Card.Rank rank : Card.Rank.values()) { deck.add(new Card(rank, suit)); } } } private final Cards cards; /** * Creates an unshuffled deck of cards. */ public Deck() { cards = new Cards(deck); } public Cards getCards() { return cards; } public void shuffle() { Collections.shuffle(cards); } public Card deal() { return cards.remove(0); } public void burn() { cards.remove(0); } public String toString() { StringBuilder sb = new StringBuilder(); for (Card card : cards) { sb.append(card.toString()); } return sb.toString(); } }