Beispiel #1
0
        /// <summary>
        /// 设置申请过的数据 要对搜索列表
        /// </summary>
        public void SetApplyItemDatas(List <AllianceApply> accountApplies)
        {
            applyItemDatas = new ApplyItemData[accountApplies.Count];
            for (int i = 0; i < applyItemDatas.Length; i++)
            {
                AllianceApply apply    = accountApplies[i];
                ApplyItemData itemData = new ApplyItemData();
                itemData.legionID  = apply.AllianceId;
                itemData.applyTime = apply.ApplyTime;
                applyItemDatas[i]  = itemData;
            }

            //维护搜索列表
            SearchItemDatasProcess();
        }
Beispiel #2
0
        public void SetAllianceApplys(List <AllianceApply> applies)
        {
            int d = applies.Count - legionData.listRequestJoin.Count;

            if (d > 0)
            {
                for (int i = 0; i < d; i++)
                {
                    RequestJoinData rjd = new RequestJoinData();
                    legionData.listRequestJoin.Add(rjd);
                }
            }
            else if (d < 0)
            {
                for (int i = 0; i < -d; i++)
                {
                    legionData.listRequestJoin.RemoveAt(legionData.listRequestJoin.Count - 1);
                }
            }

            int index = 0;

            for (int i = 0; i < applies.Count; i++)
            {
                RequestJoinData rjd  = legionData.listRequestJoin[index];
                AllianceApply   data = applies[i];
                if (data == null) //如果为空就移除
                {
                    legionData.listRequestJoin.RemoveAt(legionData.listRequestJoin.Count - 1);
                    continue;
                }
                rjd.name      = data.Name;
                rjd.level     = data.Level;
                rjd.approveID = data.Uid;
                rjd.headIcon  = data.Portrait;
                rjd.headFrame = data.Frame;
                index++;
            }

            if (LegionEvent.NotifyUpdateLegionData != null)
            {
                LegionEvent.NotifyUpdateLegionData(legionData);
            }
        }