예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Deck firstDeck = new Deck();

            firstDeck.Deal();
            firstDeck.Reset();
            firstDeck.Shuffle();
            Person firstPerson = new Person("Jimmy");

            firstPerson.Draw(firstDeck);
            firstPerson.Draw(firstDeck);
            firstPerson.Draw(firstDeck);
            firstPerson.Draw(firstDeck);
            firstPerson.Draw(firstDeck);
            firstPerson.Discard(3);
            firstPerson.Discard(0);
            firstPerson.Discard(300);
            firstPerson.Discard(-1);
        }
예제 #2
0
        static void Main(string[] args)
        {
            Deck deck = new Deck();

            deck.Deal();
            deck.Deal();
            deck.Deal();
            deck.Reset();
            deck.Deal();
            deck.Shuffle();
            deck.Deal();
            deck.Deal();
            deck.Deal();

            Player danny = new Player("Danny");

            danny.Draw(deck);
            danny.Draw(deck);
            danny.Draw(deck);
            danny.ShowHand();
            danny.Discard(0);
            danny.ShowHand();
        }
 public void Draw(Deck currDeck)
 {
     hand.Add(currDeck.Deal());
 }
예제 #4
0
 public Card Draw(Deck new_Deck)
 {
     return(new_Deck.Deal());
 }
예제 #5
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.
 public Card Draw(Deck game)
 {
     hand.Add(game.Deal());
     Console.WriteLine(hand[hand.Count - 1]);
     return(hand[hand.Count - 1]);
 }
예제 #6
0
 public void Draw(Deck deck)
 {
     Hand.Add(deck.Deal());
 }