Skip to content

Commit

Permalink
Fixed issue ucsb-cs56-projects#10.
Browse files Browse the repository at this point in the history
  • Loading branch information
The3TC committed Nov 11, 2016
2 parents 777e744 + a0471cd commit 4ed1e5e
Show file tree
Hide file tree
Showing 11 changed files with 792 additions and 395 deletions.
2 changes: 1 addition & 1 deletion src/edu/ucsb/cs56/projects/games/poker/CompareHands.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ else if(isOnePair(player))
}


private ArrayList<Integer> sortHand(ArrayList<Card> player) {
public ArrayList<Integer> sortHand(ArrayList<Card> player) {
ArrayList<Integer> sortedHand=new ArrayList<Integer>();
for(int i=0;i<player.size();i++) {
sortedHand.add(player.get(i).getValue());
Expand Down
7 changes: 6 additions & 1 deletion src/edu/ucsb/cs56/projects/games/poker/Hand.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
public class Hand extends ArrayList<Card> implements Serializable{

private int handValue;

/** Constructor to set specific hands */
public Hand(Card card1, Card card2){
this.add(card1);
this.add(card2);
}
/**
* Constructor creates a Hand of Cards by calling the Deck to give Hand these cards
* Creates a 2 Card Hand for the player
Expand Down Expand Up @@ -86,4 +90,5 @@ public int getLowCardValue(){
}
return min;
}

}
9 changes: 8 additions & 1 deletion src/edu/ucsb/cs56/projects/games/poker/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public class Player implements Serializable {
private int wins;
public PokerGame delegate;

/** Creates a Poker player with a set hand */
public Player(Hand hand){
pokerHand = hand;
chips = 100;
wins = 0;
}
/**
* Creates a Poker player with a designated number of chips
* @param int number of chips, the Deck of Cards
Expand All @@ -30,7 +36,8 @@ public Player(int chips, Deck deck) {
public Hand getHand() {
return pokerHand;
}



/**
* Get Player's Chips
* @return int
Expand Down
Loading

0 comments on commit 4ed1e5e

Please sign in to comment.