Question: Java Code! War Cards. This is the Player class of the Code. I need help. public class Player { public Player(int id){} // Create the
Java Code! War Cards. This is the Player class of the Code. I need help. public class Player { public Player(int id){} // Create the player with their id. The pile's name should be "P1" or "P2" based on that id. Initially they are not the winner of the game. id is the player's id or name public void addCard(Card card){} // Add a single card to the bottom of the player's pile. card = the card to add. public void addCards(Pile cards){} // Add the collection of cards from the incoming pile to the bottom of player's pile, in order. Do not remove cards from the incoming pile! Use Pile's getCards() method to get the collection of cards to add. cards - the pile of cards to add to the player's deck/pile public boolean hasCard(){} //returns if there are cards in the player's pile public Card drawCard(){} //Remove a card from the top of the pile. The intention is the card should switch to be face up. The new card is removed from the top of the pile. public void setWinner(){} public boolean isWinner(){} //Declare the player to be winner. } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
