예제 #1
0
 public void TestInitPlayerCards()
 {
     DealerCardList = new List <CardDto>();
     //庄家和闲家各发两张牌
     //闲家
     for (int i = 0; i < 2; i++)
     {
         string  cardName = CardColor.GetString(1) + CardWeight21.GetString(1);
         CardDto card     = new CardDto(cardName, 1, 1);
         player.Add(card);
     }
     //庄家
     for (int i = 0; i < 2; i++)
     {
         CardDto card = libraryModel.Deal();
         DealerCardList.Add(card);
     }
 }
예제 #2
0
 private void create(int CardsNum)
 {
     CardQueue = new Queue <Card>();
     while (CardsNum > 0)
     {
         //创建普通的牌
         for (int color = CardColor.CLUB; color <= CardColor.SQUARE; color++)
         {
             for (int weight = CardWeight21.ONE; weight <= CardWeight21.KING; weight++)
             {
                 string cardName = CardColor.GetString(color) + CardWeight21.GetString(weight);
                 Card   card     = new Card(cardName, color, weight);
                 //添加到 CardQueue  里面
                 CardQueue.Enqueue(card);
             }
         }
         CardsNum--;
     }
 }
예제 #3
0
        /// <summary>
        /// 创建牌
        /// </summary>
        private void create()
        {
            cardDtos = new Queue <CardDto>();
            for (int color = CardColor.CLUE; color <= CardColor.SQUARE; color++)
            {
                for (int weight = CardWeight.THREE; weight <= CardWeight.TWO; weight++)
                {
                    string  cardName = CardColor.GetString(color) + CardWeight.GetString(weight);
                    CardDto cardDto  = new CardDto(color, weight, cardName);
                    this.cardDtos.Enqueue(cardDto);
                }
            }
            //大王小王
            CardDto sJoker = new CardDto(CardColor.NONE, CardWeight.SJOKER, "SJoker");
            CardDto lJoker = new CardDto(CardColor.NONE, CardWeight.LJOKER, "LJoker");

            this.cardDtos.Enqueue(sJoker);
            this.cardDtos.Enqueue(lJoker);
        }
예제 #4
0
        private void Create()
        {
            cardQueue = new Queue <CardDto>();
            //创建普通的牌
            for (int color = CardColor.CLUB; color <= CardColor.SQUARE; color++)
            {
                for (int weight = CardWeight.THREE; weight <= CardWeight.TWO; weight++)
                {
                    string  cardName = CardColor.GetString(color) + CardWeight.GetString(weight);
                    CardDto card     = new CardDto(cardName, color, weight);
                    //添加到CardQuene里面
                    cardQueue.Enqueue(card);
                }
            }
            CardDto sJoker = new CardDto("SJoker", CardColor.NONE, CardWeight.SJOKER);
            CardDto lJoker = new CardDto("LJoker", CardColor.NONE, CardWeight.LJOKER);

            cardQueue.Enqueue(sJoker);
            cardQueue.Enqueue(lJoker);
        }