Example #1
0
        /// <summary>
        /// 保存一下卡牌数据
        /// </summary>
        ///1 21dian 2爆牌 3不要
        /// <param name="state"></param>
        /// <param name="isDouble"></param>
        public void SaveList(int state, bool isDouble)
        {
            PlayerCardDto playerCardDto = new PlayerCardDto();

            playerCardDto.CardList.AddRange(player.CardList);
            playerCardDto.CardState = state;
            playerCardDto.Weight    = CardWeight21.GetWeight(player.CardList);
            playerCardDto.isDouble  = isDouble;
            player.SpliteCardListList.Add(playerCardDto);
        }
Example #2
0
        public string getPlayerCardType()
        {
            string playerCardType = "";

            if (player.CardList.Count == 2)
            {
            }
            if (player.CardList.Count == 2 && player.CardList[0].Weight == player.CardList[1].Weight)//对子
            {
                if (player.CardList[0].Weight == 1)
                {
                    playerCardType += "AA";
                }
                else if (player.CardList[0].Weight >= 10)
                {
                    playerCardType += "TT";
                }
                else
                {
                    playerCardType += player.CardList[0].Weight.ToString();
                    playerCardType += player.CardList[0].Weight.ToString();
                }
            }
            else if (isContainA(player.CardList))
            {
                int otherWeight = 0;
                foreach (CardDto c in player.CardList)
                {
                    otherWeight += c.Weight;
                }
                otherWeight -= 1;
                if (otherWeight <= 9)
                {
                    playerCardType += "A";
                    playerCardType += otherWeight.ToString();
                }
                else
                {
                    playerCardType += "H";
                    playerCardType += CardWeight21.GetWeight(player.CardList).ToString();
                }
            }
            else
            {
                playerCardType += "H";
                playerCardType += CardWeight21.GetWeight(player.CardList).ToString();
            }
            return(playerCardType);
        }
Example #3
0
 public int GetPlayerWeight()
 {
     return(CardWeight21.GetWeight(player.CardList));
 }
Example #4
0
 public int GetDealerWeight()
 {
     return(CardWeight21.GetWeight(DealerCardList));
 }
Example #5
0
 public bool isPlayer21()
 {
     return(CardWeight21.GetWeight(player.CardList) == 21);
 }