I'm currently making a card game(made a custom one instead of lame poker), and basically I want to add pictures based on the value of the card. It's separated into a/b(a being the suit, b being the value).
Chunk of code I'm assuming will change to add pictures (or it's the card class?)
cards = new ArrayList < > ();
for (int a = 0 ; a <= 3 ; a++)
{
for (int b = 0 ; b <= 12 ; b++)
{
cards.add (new Card (a, b));
}
}
}
//Method to draw a card and remove card from the current deck
public Card PlayerCardDraw ()
{
Random generator = new Random ();
int index = generator.nextInt (cards.size ());
return cards.remove (index);
}
//Adds a card to player 1's hand kept in an arraylist to group cards to an individual player
public ArrayList <Card> p1Hand;
public ArrayList Card> P1CardDraw ()
{
p1Hand = new ArrayList < > ();
p1Hand.add (PlayerCardDraw ());
return p1Hand;
}