// Player.java import java.util.Scanner; public class Player { private Hand hand; private int winCount; private Scanner in; public Player() { hand = new Hand(); in = new Scanner(System.in); winCount = 0; } public void addWin() { winCount++; } public int getWins() { return winCount; } public int getScore() { return hand.totalValue(); } public void addCard(Card c) { hand.add(c); } public void printHand() { System.out.println(hand); } public void clearHand() { hand = new Hand(); } public boolean hit() { System.out.println(hand); System.out.println("Your hand value now is " + hand.totalValue()); System.out.println("Do you want to hit or stay? "); String response = in.next(); if (response.equalsIgnoreCase("hit")) { return true; } else if (response.equalsIgnoreCase("stay")) { return false; } else { System.out.println("Please enter \"hit\" or \"stay\"."); return hit(); } } }