コード例 #1
0
        //根据牌数组刷新手牌
        public async Task RefrshHand <T>(T notSorthands) where T : IList <int>
        {
            List <int> hands = JoyLandlordsCardTool.CardInSizeSort(notSorthands);

            for (int i = 0; i < hands.Count; i++)
            {
                if (i >= HandLists.Count)
                {
                    HandLists.Add(JoyLandlordsHandFactory.Create(hands[i]));
                }
                HandLists[i].SetCardDataUI(hands[i], i);
            }
            for (int i = hands.Count; i < HandLists.Count; i++)
            {
                HandLists[i].Dispose();
            }
            if (HandLists.Count > hands.Count)
            {
                HandLists.RemoveRange(hands.Count, HandLists.Count - hands.Count);
            }
            foreach (var hand in HandLists)
            {
                hand.CancelStatu();
            }
            await Task.Delay(100);
        }
コード例 #2
0
        public async void Deal(params object[] objs)
        {
            RepeatedField <int> cards = objs[0] as RepeatedField <int>;
            List <int>          FromBigArriveSmallList = JoyLandlordsCardTool.CardInSizeSort(cards);

            ClearHandDic();
            for (int i = 0; i < FromBigArriveSmallList.Count; i++)
            {
                await ETModel.Game.Scene.GetComponent <TimerComponent>().WaitAsync(200);

                HandLists.Add(JoyLandlordsHandFactory.Create(FromBigArriveSmallList[i], i));
            }
        }