
Untitled
By: a guest on
Jun 17th, 2012 | syntax:
None | size: 1.33 KB | hits: 16 | expires: Never
import java.util.ArrayList;
import java.util.Collections;
public class Deck extends ArrayList<Card>
{
private static int deckMultiplier;
public static boolean aceHigh;
public static boolean kingHigh;
public Deck(int deckMultiplier)
{
this.deckMultiplier = deckMultiplier;
if(deckMultiplier > 0)
{
int cardIndex = 0;
for(int suit = 0; suit <= 3; suit++)
{
for(int rank = 1; rank <= 13; rank++)
{
//Card temp = new Card(rank, suit);
this.add((Card)new Card(rank, suit));
cardIndex++;
}
}
}
}
public boolean shuffleDeck()
{
if(this.size() > 0)
{
Collections.shuffle(this);
return true;
}
else {
return false;
}
}
public static void AceHigh()
{
aceHigh = true;
}
public static void KingHigh()
{
kingHigh = true;
}
// this is just for testing.
public static void main(String args[]) throws Exception
{
Deck newDeck = new Deck(1);
}
}