Android Open Source - pokerdrome Deck






From Project

Back to project page pokerdrome.

License

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.

Java Source Code

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

}




Java Source Code List

com.darlose.pokerdrome.CardDeck.java
com.darlose.pokerdrome.Card.java
com.darlose.pokerdrome.Cards.java
com.darlose.pokerdrome.Deck.java
com.darlose.pokerdrome.Evaluate.java
com.darlose.pokerdrome.Game.java
com.darlose.pokerdrome.HandRank.java
com.darlose.pokerdrome.MainActivity.java
com.darlose.pokerdrome.Player.java
com.darlose.pokerdrome.Tables.java
com.darlose.pokerdrome.VideoPokerActivity.java