public class Euchre
extends java.lang.Object
Constructor and Description |
---|
Euchre()
A constructor for Euchre.
|
Modifier and Type | Method and Description |
---|---|
boolean |
alone()
A method to check if alone is true or false..
|
void |
assignPoints()
A method to assign points to teams.
|
Player |
assignTrick(java.util.ArrayList<Player> players,
int dead,
Player current)
A method to assign the trick.
|
java.util.ArrayList<Card> |
createDeck()
A helper method used to create the deck in main.
|
Card |
deal()
A method that give each player 5 cards from the shuffled deck.
|
boolean |
gameStatus()
A method that returns the games status.
|
Player |
getDealer()
A method to return the dealer.
|
java.util.ArrayList<Card> |
getDeck()
A method to return the deck.
|
Player |
getFirstPlayer(int dPlayer)
A method to return the first player.
|
java.util.ArrayList<Card> |
getPlay()
A method to return the played cards.
|
java.util.ArrayList<Player> |
getPlayers()
A method to return the players.
|
int |
getT1Score()
A accessor used to get team 1s' score.
|
int |
getT1Trick()
A accessor to return team 1's trick count.
|
int |
getT2Score()
A accessor used to get team 2s' score.
|
int |
getT2Trick()
A accessor to return team 2's trick count.
|
Suits |
getTrump()
A method to return the trump.
|
Player |
nextPlayer(int current,
int dPlayer)
A method that returns next player.
|
java.util.ArrayList<Card> |
organizeHand(java.util.ArrayList<Card> hand)
A method used to organize the hand.
|
boolean |
playable(Card lead,
Card played,
java.util.ArrayList<Card> hand)
A method that checks if the card played is playable or not.
|
static void |
printCard(Card c)
A method that prints a card for turn up.
|
static void |
printHand(java.util.ArrayList<Card> hand)
A method that prints the hand.
|
void |
setAlone(boolean b)
A method to set the alone boolean.
|
void |
setT1Score(int t1)
A mutator used to change team 1s' score.
|
static void |
setT1Trick(int t1)
A mutator to set team 1's trick count.
|
void |
setT2Score(int t2)
A mutator used to change team 2s' score.
|
static void |
setT2Trick(int t2)
A mutator to set team 2's trick count.
|
void |
setTrump(Suits t)
A mutator that sets trump.
|
void |
shuffle(java.util.ArrayList<Card> deck)
A method that shuffles the deck ArrayList then deals.
|
void |
shuffleTest(java.util.ArrayList<Card> deck)
A method that shuffles the deck ArrayList then deals.
|
void |
swapDealer()
A method used to swap the dealer.
|
void |
t1Point(int p)
An adder that increments team 1's score.
|
void |
t2Point(int p)
An incrementor that increments team 2's score.
|
Card |
takeTrick(java.util.ArrayList<Card> active)
A method that determines which card is the highest out of those
played, and will return that card.
|
public Euchre()
public java.util.ArrayList<Player> getPlayers()
public Suits getTrump()
public java.util.ArrayList<Card> getPlay()
public java.util.ArrayList<Card> getDeck()
public boolean alone()
public java.util.ArrayList<Card> createDeck()
public void swapDealer()
public int getT1Score()
public void setT1Score(int t1)
t1
- a desired scorepublic void t1Point(int p)
p
- the point valuepublic int getT2Score()
public void setT2Score(int t2)
t2
- a desired scorepublic void t2Point(int p)
p
- the point valuepublic boolean gameStatus()
public void shuffle(java.util.ArrayList<Card> deck)
deck
- the games deckpublic void shuffleTest(java.util.ArrayList<Card> deck)
deck
- the games deckpublic boolean playable(Card lead, Card played, java.util.ArrayList<Card> hand)
lead
- The lead cardplayed
- The card to check if validhand
- The players handpublic void setTrump(Suits t)
t
- the suit to set trumppublic Card takeTrick(java.util.ArrayList<Card> active)
active
- an array list of cards that were playedpublic int getT1Trick()
public static void setT1Trick(int t1)
t1
- What you want to set the trick topublic int getT2Trick()
public static void setT2Trick(int t2)
t2
- What you want to set the trick topublic Card deal()
public java.util.ArrayList<Card> organizeHand(java.util.ArrayList<Card> hand)
hand
- an ArrayList of cards that represents the handpublic Player getDealer()
public Player getFirstPlayer(int dPlayer)
dPlayer
- the dead playerpublic void assignPoints()
public void setAlone(boolean b)
b
- the boolean to be setpublic Player assignTrick(java.util.ArrayList<Player> players, int dead, Player current)
players
- a array list of playersdead
- dead playercurrent
- the current playerpublic Player nextPlayer(int current, int dPlayer)
current
- The current player indexdPlayer
- The player not playing if alone.public static void printHand(java.util.ArrayList<Card> hand)
hand
- An array list of a cards to be printedpublic static void printCard(Card c)
c
- A card to be printed