private void ShowAsChannelFriend() { this.FriendInfosUIVisibility = true; this.FriendFindsUIVisibility = false; this.UpdateRecommendsPanelActive(); this.FriendInfoUnits.Clear(); List <BuddyInfo> friends = FriendManager.Instance.GetFriends(); friends.Sort(new Comparison <BuddyInfo>(FriendUIViewModel.FriendSortCompare)); string text = DataReader <GlobalParams> .Get("friend_limit_i").value; text = GameDataUtils.SplitString4Dot0(text); if (friends.get_Count() > 0) { this.FriendTip = string.Empty; string color = TextColorMgr.GetColor(friends.get_Count().ToString(), "A45A41", string.Empty); this.FriendNum = "好友数量:" + color + "/" + text; for (int i = 0; i < friends.get_Count(); i++) { BuddyInfo sdata = friends.get_Item(i); OOFriendInfoUnit o = this.CreateFriendInfoUnit(OOFriendInfoUnit.UnitType.Friend, sdata, false); this.FriendInfoUnits.Add(o); } } else { this.FriendTip = GameDataUtils.GetChineseContent(502082, false); string color2 = TextColorMgr.GetColor("0", "A45A41", string.Empty); this.FriendNum = "好友数量:" + color2 + "/" + text; } }
private void ShowAsChannelBlack() { this.FriendInfosUIVisibility = true; this.FriendFindsUIVisibility = false; this.UpdateRecommendsPanelActive(); this.FriendInfoUnits.Clear(); List <BuddyInfo> blacks = FriendManager.Instance.GetBlacks(); if (blacks.get_Count() > 0) { this.FriendTip = string.Empty; string color = TextColorMgr.GetColor(blacks.get_Count().ToString(), "A45A41", string.Empty); this.FriendNum = "黑名单数量:" + color; for (int i = 0; i < blacks.get_Count(); i++) { BuddyInfo sdata = blacks.get_Item(i); OOFriendInfoUnit o = this.CreateFriendInfoUnit(OOFriendInfoUnit.UnitType.Black, sdata, false); this.FriendInfoUnits.Add(o); } } else { this.FriendTip = GameDataUtils.GetChineseContent(502084, false); string color2 = TextColorMgr.GetColor("0", "A45A41", string.Empty); this.FriendNum = "黑名单数量:" + color2; } }
private void ShowAsChannelAsk() { this.FriendInfosUIVisibility = true; this.FriendFindsUIVisibility = false; this.UpdateRecommendsPanelActive(); this.FriendInfoUnits.Clear(); List <BuddyInfo> asks = FriendManager.Instance.GetAsks(); string text = DataReader <GlobalParams> .Get("friend_invite_limit_i").value; text = GameDataUtils.SplitString4Dot0(text); if (asks.get_Count() > 0) { this.FriendTip = string.Empty; string color = TextColorMgr.GetColor(asks.get_Count().ToString(), "A45A41", string.Empty); this.FriendNum = "申请数量:" + color + "/" + text; for (int i = 0; i < asks.get_Count(); i++) { BuddyInfo sdata = asks.get_Item(i); OOFriendInfoUnit o = this.CreateFriendInfoUnit(OOFriendInfoUnit.UnitType.Ask, sdata, false); this.FriendInfoUnits.Add(o); } } else { this.FriendTip = GameDataUtils.GetChineseContent(502083, false); string color2 = TextColorMgr.GetColor("0", "A45A41", string.Empty); this.FriendNum = "申请数量:" + color2 + "/" + text; } }
public void RandomShowRecommendsFriends() { List <BuddyInfo> recommendInfo = FriendManager.Instance.m_recommendInfo; if (recommendInfo != null) { int num = 3; List <TuiJianHaoYou> dataList = DataReader <TuiJianHaoYou> .DataList; TuiJianHaoYou tuiJianHaoYou = dataList.get_Item(0); if (tuiJianHaoYou != null) { num = tuiJianHaoYou.displayNumber; } if (num > recommendInfo.get_Count()) { num = recommendInfo.get_Count(); } for (int i = 0; i < recommendInfo.get_Count(); i++) { BuddyInfo buddyInfo = recommendInfo.get_Item(i); int num2 = Random.Range(0, recommendInfo.get_Count()); recommendInfo.set_Item(i, recommendInfo.get_Item(num2)); recommendInfo.set_Item(num2, buddyInfo); } this.UpdateRecommendsFriends(recommendInfo, num); } }
public void AddNewBuddy(BuddyInfo buddy) { if (!Buddies.Contains(buddy)) { Buddies.Add(buddy); } }
public void SetData(BuddyInfo info, int times, int minLv, int maxLv) { this.Info = info; this.ProtectTimes = times; this.mMinLevel = minLv; this.mMaxLevel = maxLv; this.RefreshRoom(); }
public BuddyInfo getInfo() { BuddyInfo ret = new BuddyInfo(pjsua2PINVOKE.Buddy_getInfo(swigCPtr), true); if (pjsua2PINVOKE.SWIGPendingException.Pending) { throw pjsua2PINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public void SetData(int quality, BuddyInfo info) { this.SetData(info, -1, 0, 0); this.mTxCar.set_text(TramcarManager.Instance.TRAMCAR_NAME[quality]); this.mTxCar.get_gameObject().SetActive(true); this.mBtnAgree.get_gameObject().SetActive(true); this.mBtnReject.get_gameObject().SetActive(true); this.mBtnInvite.get_gameObject().SetActive(false); this.mImgTips.get_gameObject().SetActive(false); this.mTxTips.get_gameObject().SetActive(false); }
private void Remove2AllFriends(BuddyInfo buddyInfo) { for (int i = 0; i < this.AllFriends.get_Count(); i++) { if (this.AllFriends.get_Item(i).id == buddyInfo.id) { this.AllFriends.Remove(this.AllFriends.get_Item(i)); break; } } }
private void Update2AllFriends(BuddyInfo buddyInfo) { for (int i = 0; i < this.AllFriends.get_Count(); i++) { if (this.AllFriends.get_Item(i).id == buddyInfo.id) { BuddyRelation.BR relation = this.AllFriends.get_Item(i).relation; this.AllFriends.set_Item(i, buddyInfo); this.AllFriends.get_Item(i).relation = relation; } } }
public bool IsRelationOfBlack(long uid) { for (int i = 0; i < this.AllFriends.get_Count(); i++) { BuddyInfo buddyInfo = this.AllFriends.get_Item(i); if (buddyInfo.id == uid) { return(buddyInfo.relation == BuddyRelation.BR.BuddyBlack || buddyInfo.relation == BuddyRelation.BR.StrangerBlack); } } return(false); }
private void ChangeRelation2AllFirends(long uid, BuddyRelation.BR relation) { for (int i = 0; i < this.AllFriends.get_Count(); i++) { BuddyInfo buddyInfo = this.AllFriends.get_Item(i); if (buddyInfo.id == uid) { buddyInfo.relation = relation; break; } } }
public List <BuddyInfo> GetBlacks() { List <BuddyInfo> list = new List <BuddyInfo>(); for (int i = 0; i < this.AllFriends.get_Count(); i++) { BuddyInfo buddyInfo = this.AllFriends.get_Item(i); if (buddyInfo.relation == BuddyRelation.BR.BuddyBlack || buddyInfo.relation == BuddyRelation.BR.StrangerBlack) { list.Add(buddyInfo); } } return(list); }
private OOFriendInfoUnit CreateFriendInfoUnit(OOFriendInfoUnit.UnitType status, BuddyInfo sdata, bool isSendRecommdReq = false) { return(new OOFriendInfoUnit { UnitStatus = status, FriendUID = sdata.id, FriendIcon = UIUtils.GetRoleSmallIcon(sdata.career), FriendName = sdata.name, OffLineStatus = sdata.online, IsFriendRecommend = isSendRecommdReq, VIPLevel1 = GameDataUtils.GetNumIcon10(sdata.vipLv, NumType.Yellow_light), VIPLevel2 = GameDataUtils.GetNumIcon1(sdata.vipLv, NumType.Yellow_light), Level = "Lv." + sdata.lv, BattlePower = sdata.fighting.ToString() }); }
public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("PromotionInfo"); oprot.WriteStructBegin(struc); TField field = new TField(); if (__isset.promotionType) { field.Name = "promotionType"; field.Type = TType.I32; field.ID = 1; oprot.WriteFieldBegin(field); oprot.WriteI32((int)PromotionType); oprot.WriteFieldEnd(); } if (PromotionDetail != null && __isset.promotionDetail) { field.Name = "promotionDetail"; field.Type = TType.Struct; field.ID = 2; oprot.WriteFieldBegin(field); PromotionDetail.Write(oprot); oprot.WriteFieldEnd(); } if (BuddyInfo != null && __isset.buddyInfo) { field.Name = "buddyInfo"; field.Type = TType.Struct; field.ID = 51; oprot.WriteFieldBegin(field); BuddyInfo.Write(oprot); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
private static int FriendSortCompare(BuddyInfo AF1, BuddyInfo AF2) { int result = 0; if (!AF1.online && AF2.online) { result = 1; } else if (AF1.online && !AF2.online) { result = -1; } else if (AF1.fighting < AF2.fighting) { result = 1; } else if (AF1.fighting > AF2.fighting) { result = -1; } return(result); }
public void UpdateRecommendsFriends(List <BuddyInfo> finds, int count) { this.FriendRecommends.Clear(); if (finds != null) { for (int i = 0; i < count; i++) { BuddyInfo buddyInfo = finds.get_Item(i); OOFriendInfoUnit o; if (FriendManager.Instance.IsRelationOfBuddy(buddyInfo.id)) { o = this.CreateFriendInfoUnit(OOFriendInfoUnit.UnitType.AddIsFriend, buddyInfo, true); } else { o = this.CreateFriendInfoUnit(OOFriendInfoUnit.UnitType.AddNotFriend, buddyInfo, true); } this.FriendRecommends.Add(o); } } this.UpdateRecommendsPanelActive(); }
public override string ToString() { StringBuilder __sb = new StringBuilder("PromotionInfo("); bool __first = true; if (__isset.promotionType) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("PromotionType: "); __sb.Append(PromotionType); } if (BuddyInfo != null && __isset.buddyInfo) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("BuddyInfo: "); __sb.Append(BuddyInfo == null ? "<null>" : BuddyInfo.ToString()); } if (PromotionDetail != null && __isset.promotionDetail) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("PromotionDetail: "); __sb.Append(PromotionDetail == null ? "<null>" : PromotionDetail.ToString()); } __sb.Append(")"); return(__sb.ToString()); }
private void RefreshInfoPanel() { this.mTxPackNumber.set_text(string.Format("拥有刷新券\n<color=#fdb22f>{0}</color>", BackpackManager.Instance.OnGetGoodCount(71034))); ResourceManager.SetSprite(this.mSelfIcon, UIUtils.GetRoleSmallIcon(EntityWorld.Instance.EntSelf.TypeID)); this.mFriendIcon.get_gameObject().SetActive(false); if (TramcarManager.Instance.FightInfo != null) { this.mTxProtectTimes.set_text(string.Format("今天剩余次数\n<color=#fdb22f>{0}</color>", TramcarManager.Instance.FightInfo.todayProtectTimes)); long helpId = TramcarManager.Instance.FightInfo.helpRoleId; if (helpId > 0L) { if (helpId == this.mLastProtectFriendId) { this.mFriendIcon.get_gameObject().SetActive(true); } else { if (this.mFriendInfos == null) { this.mFriendInfos = FriendManager.Instance.GetFriends(); } BuddyInfo buddyInfo = this.mFriendInfos.Find((BuddyInfo e) => e.id == helpId); if (buddyInfo != null) { this.mLastProtectFriendId = helpId; this.mFriendIcon.get_gameObject().SetActive(true); ResourceManager.SetSprite(this.mFriendIcon, UIUtils.GetRoleSmallIcon(buddyInfo.career)); } else { Debug.Log("<color=red>Error:</color>矿车邀请列表里没好友:" + helpId); } } } } }
public void Remove(BuddyInfo name) { List.Remove(name); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BuddyInfo obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
public BuddyInfo getInfo() { BuddyInfo ret = new BuddyInfo(pjsua2PINVOKE.Buddy_getInfo(swigCPtr), true); if (pjsua2PINVOKE.SWIGPendingException.Pending) throw pjsua2PINVOKE.SWIGPendingException.Retrieve(); return ret; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BuddyInfo obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }
public void Add(BuddyInfo name) { List.Add(name); }
private void Remove2Asks(BuddyInfo buddyInfo) { this.Remove2Asks(buddyInfo.id); }
private void Add2Asks(BuddyInfo buddyInfo) { this.Remove2Asks(buddyInfo.id); this.Asks.Add(buddyInfo); this.SetIsAsksTipOn(); }
private void Add2AllFriends(BuddyInfo buddyInfo) { this.Remove2AllFriends(buddyInfo); this.AllFriends.Add(buddyInfo); }