예제 #1
0
파일: Player.cs 프로젝트: jxxparker/c-
        public Card draw(Deck onDeck)
        {
            Card member = onDeck.deal();

            hand.Add(member);
            return(member);
        }
예제 #2
0
        public Card draw(Deck rummydeck)
        {
            Card removedcard = rummydeck.deal();

            hand.Add(removedcard);
            return(removedcard);
        }
예제 #3
0
        public Card draw(Deck deck)
        {
            Card cardDrawn = deck.deal();

            hand.Add(cardDrawn);
            return(cardDrawn);
        }
예제 #4
0
        public void draw(Deck deck)
        {
            Card myCard = deck.deal();

            System.Console.WriteLine($"You got {myCard.stringVal} of {myCard.suit}");
            hand.Add(myCard);
        }
예제 #5
0
        public Card draw(Deck deck)
        {
            Card c = deck.deal();

            newDeck.Add(c);
            return(c);
        }
예제 #6
0
파일: Player.cs 프로젝트: dimayasin/C_Sharp
        public Card draw(Deck D)
        {
            Card NewCard = D.deal();

            hand.Add(NewCard);
            return(NewCard);
        }
예제 #7
0
        public Card draw(Deck deck)
        {
            Card card = deck.deal();

            Hand.Add(card);
            return(card);
        }
예제 #8
0
        public Card draw(Deck addhand)  //Give the player a draw method this needs to reference the Deck object
        {
            Card newCard = addhand.deal();

            hand.Add(newCard);
            return(newCard);
        }
예제 #9
0
파일: Player.cs 프로젝트: chelxx/C-Sharp
        public Card draw(Deck deck) // The player's DRAW method, connects to Deck's DEAL method
        {
            Card playerCard = deck.deal();

            playerHand.Add(playerCard);
            System.Console.WriteLine("Drawing! You got " + playerCard); // HOW TO MAKE THIS SHOW UP IN TERMINAL
            return(playerCard);
        }
예제 #10
0
        public Card draw(Deck deck)
        {
            Card card = deck.deal();

            hand.Add(card);
            System.Console.WriteLine("Player drew: " + card.stringVal + " of " + card.suit);
            return(card);
        }
        public Card draw(Deck takeOne)
        {
            Card cardDealed;

            cardDealed = takeOne.deal();
            hand.Add(cardDealed);
            return(cardDealed);
        }
예제 #12
0
        public Card draw()
        {
            Card card = deck.deal();

            this.hand.Add(card);

            return(card);
        }
예제 #13
0
파일: Player.cs 프로젝트: nicholasdefina/C-
        public Card draw(Deck addhand)

        {
            Card newCard = addhand.deal();

            hand.Add(newCard);
            return(newCard);
        }
예제 #14
0
        static void Main(string[] args)             // This is where we call our functions
        {
            Player chelsea = new Player("Chelsea"); // Enter Chelsea! Yay!
            Deck   myDeck  = new Deck();            // Creates a new deck of cards

            myDeck.shuffle();                       // Shuffle the deck
            chelsea.draw(myDeck);                   // Draw a card from the deck
            chelsea.discard(0);                     // Remove a card from the deck
            myDeck.deal();                          // Deals a card from the deck
            myDeck.reset();                         // Reset the deck of cards
        }
예제 #15
0
        static void Main(string[] args)
        {
            Deck myDeck = new Deck();

            Console.WriteLine("Dealing: " + myDeck.deal().ToString());
            myDeck.reset();
            myDeck.shuffle();
            Player ali = new Player("Ali");

            ali.draw();
            ali.draw();
            ali.draw();
            ali.discard(2);
        }
예제 #16
0
 // Give the Player a draw method of which draws a card from a deck, adds it to the player's hand and returns the Card. Note this method will require reference to a deck object
 public Card draw(Deck cardDrawn)
 {
     if (IsFull)
     {
         Console.WriteLine("Can't draw any more cards. Their hands card full");
         return(null);
     }
     else
     {
         Card newCards = cardDrawn.deal();
         Hand.Add(newCards);
         return(newCards);
     }
 }
예제 #17
0
        static void Main(string[] args)
        {
            Deck deck = new Deck();

            deck.deal();
            deck.reset();
            deck.shuffle();
            deck.show();
            Player p1 = new Player("Bob");

            p1.draw(deck);
            Console.WriteLine(p1.discard(0));
            Console.WriteLine(p1.discard(0));
        }
예제 #18
0
        public static void Main(string[] args)
        {
            Deck rummydeck = new Deck();

            Card removedcard = rummydeck.deal();

            rummydeck.shuffle();

            rummydeck.reset();

            Player Don = new Player("Don");

            Card cardret = Don.draw(rummydeck);

            Card cardret2 = Don.draw(rummydeck);

            Card cardret3 = Don.draw(rummydeck);

            Card Discard = Don.discard(5);
        }
예제 #19
0
        static void Main(string[] args)
        {
            Deck myDeck = new Deck();

            // myDeck.deal();
            // myDeck.deal();
            // myDeck.deal();
            // myDeck.reset();
            myDeck.shuffle();
            myDeck.deal();
            Player Art = new Player("Art");

            Art.draw(myDeck);
            Art.draw(myDeck);
            Art.draw(myDeck);
            Art.draw(myDeck);
            Art.draw(myDeck);

            Art.showHand();
            Art.discard(0);
            System.Console.WriteLine();
            Art.showHand();
        }
예제 #20
0
 public void Draw(Deck deck)
 {
     hand.Add(deck.deal());
 }
 public void draw(Deck deck)
 {
     this.hand.Add(deck.deal());
 }