Guest User

Untitled

a guest
Mar 21st, 2011
945
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. public class Player {
  3.     private Card[] holeCards = new Card[2];
  4.    
  5.     //constructor
  6.     public Player(){
  7.     }
  8.    
  9.     public Player(Card card1, Card card2){
  10.         holeCards[0] = card1;
  11.         holeCards[1] = card2;
  12.     }
  13.    
  14.     //methods
  15.     protected void setCard(Card card, int cardNum){
  16.         holeCards[cardNum] = card;
  17.     }
  18.    
  19.     protected Card getCard(int cardNum){
  20.         return holeCards[cardNum];
  21.     }
  22.    
  23.     protected int holeCardsSize(){
  24.         return holeCards.length;
  25.     }
  26.    
  27.     protected void printPlayerCards(int playerNumber){
  28.         System.out.println("Player " + (playerNumber+1) + " hole cards:");
  29.         for (int i=0;i<2;i++){
  30.             System.out.println(holeCards[i].printCard());
  31.         }
  32.         System.out.println("\n");
  33.     }
  34. }
RAW Paste Data