Beispiel #1
0
 public override void Dispose()
 {
     base.Dispose();//组件会在Dispose被销毁
     LittleRoundClearData();
     foreach (var player in FiveStarPlayerDic)
     {
         player.Value.Dispose();
     }
     FiveStarPlayerDic.Clear();
     RoomConfig.Dispose();
     RoomId             = 0;
     FriendsCircleId    = 0;
     RoomNumber         = 0;
     NeedJeweNumCount   = 0;
     FriendsCircleId    = 0;
     SmallPlayerResults = null;
     IsHaveAI           = false;
     IsPause            = false;                //房间是否暂停中
     LiangDaoCanHuCards.Clear();
     CurrOfficNum         = 0;                  //当前局数
     FirstMoCardSeatIndex = 0;                  //第一个摸牌玩家的索引 第一局就是0
     CurrRestSeatIndex    = -1;                 // 当前休息玩家索引 必须为负数 因为2.3人局流局赔付 有误
     NextRestSeatIndex    = 0;                  // 下个休息玩家索引
     CurrRoomStateType    = RoomStateType.None; //当前房间游戏状态
     ParticularMiltarys.Clear();                //小局战绩 记录信息清除
 }
Beispiel #2
0
    public void SetCareerRecordData(RepeatedField <CareerRoomRecord> temp)
    {
        CareerRooms.Clear();
        CareerRooms = temp;

        if (m_CareerIndex <= 0)
        {
            m_LastPage.SetActive(false);
        }
        else
        {
            m_LastPage.SetActive(true);
        }

        if (temp.Count <= 0)
        {
            return;
        }
        if (temp.Count < m_CareerCount)
        {
            m_NextPage.SetActive(false);
        }
        else
        {
            m_NextPage.SetActive(true); ClearCareerRecord();
        }

        UpdateCareerRecord();
    }
Beispiel #3
0
        /// <summary>
        /// Sorts a Delphi uses clause in-place.
        /// </summary>
        /// <param name="usesClause">The uses clause to sort</param>
        public static void SortUsesClause(this RepeatedField <ConditionalUnitReference> usesClause)
        {
            RepeatedField <ConditionalUnitReference> oldClause = usesClause.Clone();

            usesClause.Clear();
            usesClause.AddRange(oldClause.OrderBy(reference => reference));
        }
Beispiel #4
0
 public static void List2RepeatedField <T>(List <T> source, RepeatedField <T> target)
 {
     target.Clear();
     foreach (T t in source)
     {
         target.Add(t);
     }
 }
Beispiel #5
0
 public void UpdateCommentList(RepeatedField <FriendBaseInfo> baseInfos)
 {
     FriendCommentList.Clear();
     foreach (var v in baseInfos)
     {
         FriendCommentList.Add(v);
     }
 }
Beispiel #6
0
        private void SetNotSupportData(Transform tran, EncourageActRuleVo encouragevo, UserEncourageActVo uservo)
        {
            var nametran = tran.Find("SupporterActivityName/Text");

            nametran.gameObject.Show();
            var name     = nametran.GetComponent <Text>();
            var timetran = tran.Find("SandGlasss/TimeLabel");

            timetran.gameObject.Show();
            var timeLabel = timetran.GetComponent <Text>();

            name.text      = encouragevo.Title;
            timeLabel.text = I18NManager.Get("SupporterActivity_Time", encouragevo.NeedTime / 60);//"时间:" +  + "小时";

            var rewardList = tran.Find("RewardList");
            var changeBtn  = tran.Find("ChangeBtn").GetButton();
            var costText   = tran.Find("Icon/Num").GetText();

            costText.text = lastcost.ToString();

            changeBtn.onClick.RemoveAllListeners();
            changeBtn.onClick.AddListener(() =>
            {
                //FlowText.ShowMessage("更换活动协议!");
                _curChooseTransform = tran;
                if (uservo.StartState == 0)
                {
                    SendMessage(new Message(MessageConst.CMD_SUPPORTERACTIVITY_REFRESH,
                                            Message.MessageReciverType.CONTROLLER, uservo));
                }
            });

            //可能三种情况:1.只出现粉丝2.只出现钻石。3.只出现道具。
            for (int i = 0; i < rewardList.childCount; i++)
            {
                rewardList.GetChild(i).gameObject.Hide();
            }

            //刷新的时候就会出现BUG了
            RepeatedField <AwardPB> enactaward = new RepeatedField <AwardPB>();

            enactaward.Clear();

            if (encouragevo.RandomFansNum > 0)
            {
                enactaward.Add(new AwardPB()
                {
                    Num = encouragevo.RandomFansNum, Resource = ResourcePB.Fans, ResourceId = 1
                });
            }
            enactaward.Add(encouragevo.Awards);

            for (int i = 0; i < enactaward.Count; i++)
            {
                rewardList.GetChild(i).gameObject.Show();
                SetPropData(rewardList.GetChild(i), enactaward[i]);
            }
        }
Beispiel #7
0
 public static void CopyToRepeatedByteString <T>(this IList <T> from, RepeatedField <ByteString> to)
     where T : INetSerializable
 {
     to.Clear();
     for (int i = 0; i < from.Count; ++i)
     {
         to.Add(ToByteString(from[i]));
     }
 }
 public static RepeatedField <int> SetRepeated <T>(this RepeatedField <int> x, int[] y)
 {
     x.Clear();
     for (int i = 0; i < y.Length; i++)
     {
         x.Add(y[i]);
     }
     return(x);
 }
 public static RepeatedField <T> SetRepeated <T>(this RepeatedField <T> x, RepeatedField <T> y)
 {
     x.Clear();
     for (int i = 0; i < y.Count; i++)
     {
         x.Add(y[i]);
     }
     return(x);
 }
Beispiel #10
0
 /// <summary>
 /// 申请列表排序
 /// </summary>
 private void SortApplyList()
 {
     onlineOtherList.Clear();
     outlineOtherList.Clear();
     foreach (var elem in StaticData.playerInfoData.listApplyInfo)
     {
         if (elem.Online)
         {
             onlineOtherList.Add(elem);
         }
         else
         {
             outlineOtherList.Add(elem);
         }
     }
     onlineOtherList  = StaticData.RepeatedFieldSortT(onlineOtherList, OtherExpSort, true);
     outlineOtherList = StaticData.RepeatedFieldSortT(outlineOtherList, OtherExpSort, true);
     StaticData.playerInfoData.listApplyInfo.Clear();
     StaticData.playerInfoData.listApplyInfo.AddRange(onlineOtherList);
     StaticData.playerInfoData.listApplyInfo.AddRange(outlineOtherList);
 }
 private void InternalClear()
 {
     if (_isMessageType)
     {
         while (_internal.Count > 0)
         {
             InternalRemoveAt(0);
         }
     }
     else
     {
         _internal.Clear();
     }
 }
 public static RepeatedField <string> SetRepeated <T>(this RepeatedField <string> x, string[] y)
 {
     x.Clear();
     for (int i = 0; i < y.Length; i++)
     {
         if (y[i] == null)
         {
             x.Add(String.Empty);
         }
         else
         {
             x.Add(y[i]);
         }
     }
     return(x);
 }
 private void InternalClear()
 {
     if (_isMessageType)
     {
         while (_internal.Count > 0)
         {
             var removedItem = _internal[0];
             _internal.RemoveAt(0);
             if (_isMessageType)
             {
                 ClearParent(removedItem);
             }
         }
     }
     else
     {
         _internal.Clear();
     }
 }
Beispiel #14
0
    public void Spin(int item, RepeatedField <Tiger.Proto.TigerBonus> bonus)
    {
        m_speed = rdSpped.Next(2000, 3000);
        m_item  = item > 5 ? item % 5 : item;

        //DebugConsole.Log(ItemStringArray[m_item]);
        m_curTimer = RollingTime; // 滚动2秒

        if (m_bonus != null)
        {
            m_bonus.Clear();
        }
        m_bonusItem = -1;

        if (bonus != null)
        {
            m_bonus = bonus;
            GetBonusItem();
        }
    }
            private static List <Match> MakeMatches(MatchProfile profile, Dictionary <string, RepeatedField <Ticket> > poolTickets)
            {
                var matches = new List <Match>();
                var count   = 0;

                // Loop through all ticket pools
                // Create a match for each group of tickets
                foreach (var entry in poolTickets)
                {
                    if (entry.Value.Count < TICKETS_PER_POOL_PER_MATCH)
                    {
                        break;
                    }

                    var tickets = new RepeatedField <Ticket>();
                    // loop over all tickets and create matches for each one
                    foreach (var ticket in entry.Value)
                    {
                        tickets.Add(ticket);
                        if (tickets.Count == TICKETS_PER_POOL_PER_MATCH)
                        {
                            // create a match
                            var match = new Match()
                            {
                                MatchId       = "profile-" + profile.Name + "-time-" + DateTime.UtcNow + "-" + count,
                                MatchProfile  = profile.Name,
                                MatchFunction = MATCH_NAME
                            };
                            match.Tickets.AddRange(tickets);
                            matches.Add(match);

                            tickets.Clear();
                            count++;
                        }
                    }
                }

                return(matches);
            }
Beispiel #16
0
 //每小局要清空的数据
 public void LittleRoundClearData()
 {
     ResidueCards = null;
     CanOperatePlayerIndex.Clear();//当前可以行进操作的玩家索引列表
     BeforeOperateResults.Clear();
     HuPaiPlayerSeatIndexs.Clear();
     LiangDaoCanHuCards.Clear();     //亮倒 所有玩家可以胡的牌
     CurrChuPaiIndex           = -1; //当前出牌玩家的索引
     CurrChuPaiCard            = -1; //当前出的哪张牌
     IsDaPiaoBeing             = false;
     EntiretyOprationAleadyNum = 0;
     LastMoPaiSeatIndex        = -1; //最后一个摸牌玩家的索引
     CanPlayCardPlayerIndex    = 0;  //正在操作的玩家索引
     QiOperateNextStep         = 0;
     _overTime = 0;
     CurrParticularMiltaryRecordData = ComponentFactory.Create <ParticularMiltaryRecordDataInfo>(); //重置录像小局数据
     EndCanOperateAndCanChuMessage   = null;                                                        //最后一条可操作消息清除
     MaiMaCard = -1;                                                                                //买马买的哪一张牌
     foreach (var player in FiveStarPlayerDic)
     {
         player.Value.LittleRoundClearData();
     }
 }