public Card[] PeekCard(int number)
 {
     List<Card> cards = new List<Card>();
     Deck tmp = new Deck(deck);
     for (int i = 0; i < number; i++)
     {
         if(!tmp.isEmpty())
             cards.Add(tmp.RemoveLast());
     }
     return cards.ToArray<Card>() ;
 }
        public void Initial()
        {
            Console.WriteLine("Initialing Game...");
            player = new Player[2];
            Deck deck = new Deck();

            Console.Write("Player 1 Name : ");
            string p1name = Console.ReadLine();
            Console.Write("Player 2 Name : ");
            string p2name = Console.ReadLine();

            deck.CreateDeck();
            deck.ShuffleDeck();

            player[0] = new Player(p1name, deck.SplitDeckFront(2));
            player[1] = new Player(p2name, deck.SplitDeckBack(2));
        }
 public Player(String Name, Deck deck)
 {
     this.Name = Name;
     this.deck = deck;
     this.score = 0;
 }
Esempio n. 4
0
 public Deck(Deck tmp)
 {
     this.cards = new Stack<Card>(tmp.Cards);
 }