Пример #1
0
        //shows hand as a string, int playernumber
        public String ToString(PlayerHand playerHand1, int playerNumber)
        {
            String playerHandString = "";

            playerHandString += "\n\nPlayer" + playerNumber.ToString() + "\n";
            for (int i = 0; i < playerHand1.length(); i++)
            {
                Card tempCard = playerHand1.GetCard(i);
                playerHandString += tempCard.ToString();
                if (i != 51)
                {
                    playerHandString += ", ";
                }
            }

            return(playerHandString);
        }
Пример #2
0
        //shows hand as a string
        public String ToString(PlayerHand playerHand1, String playerName)
        {
            String playerHandString = "";

            playerHandString += playerName.ToString() + "Cards: \n\t";
            for (int i = 0; i < playerHand1.length(); i++)
            {
                Card tempCard = playerHand1.GetCard(i);
                playerHandString += tempCard.ToString();
                if (i != 51)
                {
                    playerHandString += ", ";
                }
            }

            return(playerHandString);
        }