Beispiel #1
0
 public Sprite LoadSprite(Poker poker)
 {
     if (diceDic.ContainsKey(poker.ToString()))
     {
         return(diceDic[poker.ToString()]);
     }
     else
     {
         string path   = string.Format("download/{0}/source/uisource/gameuisource/shisanzhangpoker.drb", ConstDefine.GAME_NAME, poker.ToString());
         string name   = poker.ToString();
         Sprite sprite = AssetBundleManager.Instance.LoadSprite(path, name);
         diceDic.Add(name, sprite);
         return(sprite);
     }
 }
Beispiel #2
0
        public static List <Deck> GetAllTongHua(List <Poker> myPokers)
        {
            List <Deck> ret = new List <Deck>();

            if (myPokers == null)
            {
                return(ret);
            }
            if (myPokers.Count < 5)
            {
                return(ret);
            }
            Poker        poker = myPokers[0];
            List <Poker> lst   = new List <Poker>();

            for (int i = 0; i < myPokers.Count; i++)
            {
                for (int j = 0; j < myPokers.Count; j++)
                {
                    if (myPokers[i].Color == myPokers[j].Color)//&&myPokers[i].Size!=myPokers[j].Size
                    {
                        lst.Add(myPokers[j]);
                        if (lst.Count == 5)
                        {
                            break;
                        }
                    }
                    else
                    {
                        lst.Clear();
                    }
                }
                if (lst.Count == 5)
                {
                    ret.Add(new Deck(DeckType.TONG_HUA, lst, lst[0]));
                    break;
                }
            }
            ret.Sort();
            return(ret);
        }
 /// <summary>
 /// 按照花色大小排序
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 public int Comparator1(Poker x, Poker y)
 {
     if (x.Color < y.Color)
     {
         return(1);
     }
     else if (x.Color == y.Color)
     {
         if (x.Size <= y.Size)
         {
             return(1);
         }
         else
         {
             return(-1);
         }
     }
     else
     {
         return(-1);
     }
 }
 /// <summary>
 /// 增加手牌
 /// </summary>
 /// <param name="poker"></param>
 public void AddHandPokerProxy(Poker poker, LevelType levelType)
 {
     if (levelType == LevelType.TOU_DAO)
     {
         for (int i = 0; i < PlayerSeat.firstPokerList.Count; i++)
         {
             if (PlayerSeat.firstPokerList[i].Index == poker.Index)
             {
                 PlayerSeat.firstPokerList.RemoveAt(i);
                 PlayerSeat.handPokerList.Add(poker);
                 break;
             }
         }
     }
     else if (levelType == LevelType.ZHONG_DAO)
     {
         for (int i = 0; i < PlayerSeat.middlePokerList.Count; i++)
         {
             if (PlayerSeat.middlePokerList[i].Index == poker.Index)
             {
                 PlayerSeat.middlePokerList.RemoveAt(i);
                 PlayerSeat.handPokerList.Add(poker);
                 break;
             }
         }
     }
     else if (levelType == LevelType.WEI_DAO)
     {
         for (int i = 0; i < PlayerSeat.endPokerList.Count; i++)
         {
             if (PlayerSeat.endPokerList[i].Index == poker.Index)
             {
                 PlayerSeat.endPokerList.RemoveAt(i);
                 PlayerSeat.handPokerList.Add(poker);
                 break;
             }
         }
     }
 }
        public void Init(Poker poker, bool isPlayAnimation = false, bool isInit = false)
        {
            Poker = poker;
            string path = string.Format("download/{0}/source/uisource/gameuisource/shisanzhangpoker.drb", ConstDefine.GAME_NAME, poker.ToString());
            string name = poker.ToString();

            if (isInit)
            {
                InitFlipCardsAni();
            }
            if (!isPlayAnimation)
            {
                InitPlayAnimation();
            }
            if (name == "0_0")
            {
                positive.overrideSprite = AssetBundleManager.Instance.LoadSprite(path, name);
            }
            else
            {
                positive.overrideSprite = ShiSanZhangPrefabManager.Instance.LoadSprite(Poker);
            }
            isSelect = false;
        }
Beispiel #6
0
 public Deck(DeckType deckType, List <Poker> pokers, Poker mainPoker)
 {
     this.deckType  = deckType;
     this.pokers    = pokers;
     this.mainPoker = mainPoker;
 }