コード例 #1
0
 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>() ;
 }
コード例 #2
0
        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));
        }
コード例 #3
0
 public Player(String Name, Deck deck)
 {
     this.Name = Name;
     this.deck = deck;
     this.score = 0;
 }
コード例 #4
0
 public Deck(Deck tmp)
 {
     this.cards = new Stack<Card>(tmp.Cards);
 }