//parameterized constructor(PlayerHand hand, bool isAttacking, bool is defending) public Player(String name, PlayerCard hand, bool isAttacking, bool isDefending) { setName(name); setHand(hand); setIsAttacking(isAttacking); setIsDefending(isDefending); }
//shows hand as a string public String ToString(PlayerCard playerCard1, int playerNumber) { String playerCardString = ""; playerCardString += "\n\nPlayer" + playerNumber.ToString() + "\n"; for (int i = 0; i < playerCard1.length(); i++) { Card tempCard = playerCard1.GetCard(i); playerCardString += tempCard.ToString(); if (i != 51) { playerCardString += ", "; } } return(playerCardString); }
//shows hand as a string public String ToString(PlayerCard playerCard1, String playerName) { String playerCardString = ""; playerCardString += playerName.ToString() + "Cards: \n\t"; for (int i = 0; i < playerCard1.length(); i++) { Card tempCard = playerCard1.GetCard(i); playerCardString += tempCard.ToString(); if (i != 51) { playerCardString += ", "; } } return(playerCardString); }
public void setHand(PlayerCard hand) { this.hand = hand; }
//clone method public object Clone() { PlayerCard newplayerHand = new PlayerCard(playerCard.Clone() as CardList); return(newplayerHand); }