Esempio n. 1
0
 //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);
 }
Esempio n. 2
0
        //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);
        }
Esempio n. 3
0
        //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);
        }
Esempio n. 4
0
 public void setHand(PlayerCard hand)
 {
     this.hand = hand;
 }
Esempio n. 5
0
        //clone method


        public object Clone()
        {
            PlayerCard newplayerHand = new PlayerCard(playerCard.Clone() as CardList);

            return(newplayerHand);
        }