public void GetSupporterPower(MyDepartmentData myDepartmentData) { for (int i = 0; i < myDepartmentData.MyDepartments.Count; i++) { UserDepartmentPB pb = myDepartmentData.MyDepartments[i].UserDepartmentPb; switch (pb.DepartmentType) { case DepartmentTypePB.Active: _active = new SupporterVo(pb); break; case DepartmentTypePB.Financial: _financial = new SupporterVo(pb); break; case DepartmentTypePB.Resource: _resource = new SupporterVo(pb); break; case DepartmentTypePB.Transmission: _transmission = new SupporterVo(pb); break; } } }
public void InitData(MyDepartmentData res) { for (int i = 0; i < res.MyDepartments.Count; i++) { UserDepartmentPB pb = res.MyDepartments[i].UserDepartmentPb; switch (pb.DepartmentType) { case DepartmentTypePB.Support: MainVo = new SupporterVo(pb); //MainVo.Exp = GlobalData.PlayerModel.PlayerVo.CurrentLevelExp; break; case DepartmentTypePB.Active: Active = new SupporterVo(pb); break; case DepartmentTypePB.Financial: Financial = new SupporterVo(pb); break; case DepartmentTypePB.Resource: Resource = new SupporterVo(pb); break; case DepartmentTypePB.Transmission: Transmission = new SupporterVo(pb); break; } } FansList = res.Fanss;//new List<FansVo>(); }
public void InitData(UserLoginRes userLoginRes, UserDepartmentPB userDepartmentPb) { CreateTime = userLoginRes.User.CreateTime; Level = userDepartmentPb.Level; Exp = userDepartmentPb.Exp; Gold = userLoginRes.UserMoney.Gold; Gem = userLoginRes.UserMoney.Gem; LogoId = userLoginRes.User.Logo; AccountId = userLoginRes.User.AccountId; ChannelAccountId = userLoginRes.User.ChannelAccountId; Index = userLoginRes.User.Index; UserId = userLoginRes.User.UserId; UserName = userLoginRes.User.UserName; Apparel = userLoginRes.User.Apparel; Birthday = userLoginRes.User.Birthday; //HasGetFreeGemGift = false; NpcId = (Apparel[0] / 100) % 10; Energy = userLoginRes.UserPower.Energy; EnergyTime = userLoginRes.UserPower.EnergyTime; EncourageEnergy = userLoginRes.UserPower.EncourageEnergy; EncourageEnergyTime = userLoginRes.UserPower.EncourageEnergyTime; RecollectionEnergy = userLoginRes.UserPower.MemoriesEnergy; RecollectionEnergyTime = userLoginRes.UserPower.MemoriesEnergyTime; //获取购买金币次数 GoldNum = userLoginRes.UserBuyGemInfo.GoldNum; //获取购买体力次数 PowerNum = userLoginRes.UserBuyGemInfo.PowerNum; //购买应援体力次数 EncourageNum = userLoginRes.UserBuyGemInfo.EncourageNum; FirstRecharges = userLoginRes.FirstRecharge; UserMonthCard = userLoginRes.UserMonthCard; ExtInfo = userLoginRes.UserExtraInfo; // var pushDic = new Dictionary<string, string>(); // pushDic.Add((ClientTimer.Instance.GetCurrentTimeStamp()+86400000).ToString(),I18NManager.Get("Push_HintOldPlayer")); // UserOther = userLoginRes.User.UserOther; SdkHelper.PushAgent.InitPushData(); SdkHelper.PushAgent.Refeash(); }
public void Update(UserDepartmentPB pb, bool resetState = true) { SupporterVo vo = null; //UserDepartmentPB pb = res.MyDepartments; switch (pb.DepartmentType) { //没奖励的时候也要会动! case DepartmentTypePB.Support: MainVo = new SupporterVo(pb); break; case DepartmentTypePB.Active: Active = new SupporterVo(pb); SetAniState(resetState?1:0, 0, 0, 0); //resetState表示从挥手变成待机 pb.Awards.Count>0?1:resetState?0:2 break; case DepartmentTypePB.Financial: Financial = new SupporterVo(pb); SetAniState(0, resetState?1:0, 0, 0); break; case DepartmentTypePB.Resource: Resource = new SupporterVo(pb); SetAniState(0, 0, resetState?1:0, 0); break; case DepartmentTypePB.Transmission: Transmission = new SupporterVo(pb); SetAniState(0, 0, 0, resetState?1:0); break; } DepartmentVo dpVo = new DepartmentVo(); dpVo.UserDepartmentPb = pb; dpVo.RulePb = MyDepartmentData.GetDepartmentRule(dpVo.UserDepartmentPb.DepartmentType, dpVo.UserDepartmentPb.Level); for (int i = 0; i < GlobalData.DepartmentData.MyDepartments.Count; i++) { if (GlobalData.DepartmentData.MyDepartments[i].UserDepartmentPb.DepartmentType == dpVo.UserDepartmentPb.DepartmentType) { GlobalData.DepartmentData.MyDepartments[i] = dpVo; break; } } }
public SupporterVo(UserDepartmentPB pb) { Level = pb.Level; AwardPbs = pb.Awards; type = pb.DepartmentType; int propId = -1; switch (pb.DepartmentType) { case DepartmentTypePB.Support: break; case DepartmentTypePB.Active: propId = PropConst.SupporterActive; break; case DepartmentTypePB.Financial: propId = PropConst.SupporterFinancial; break; case DepartmentTypePB.Resource: propId = PropConst.SupporterResource; break; case DepartmentTypePB.Transmission: propId = PropConst.SupporterTransmission; break; } Prop = GlobalData.PropModel.GetUserProp(propId); if (Prop == null) { Prop = new UserPropVo(propId); } _rule = GetRule(pb.Level); //Debug.LogError(pb.DepartmentType+" _rule.Power"+_rule.Power); if (pb.DepartmentType == DepartmentTypePB.Support && _rule.Power > GlobalData.PlayerModel.BaseSupportPower) { GlobalData.PlayerModel.BaseSupportPower = _rule.Power; //Debug.LogError(GlobalData.PlayerModel.BaseSupportPower); } else { Power = _rule.Power + (GlobalData.PlayerModel.BaseSupportPower / 4);//这个值要添加一个基础值。 //Debug.LogError(Power); } DepartmentRulePB preLevelRule = GetRule(pb.Level - 1); DepartmentRulePB curLevelRule = GetRule(pb.Level); //Debug.LogError("preLevelRule"+preLevelRule?.Exp+" _rule.Exp"+ curLevelRule?.Exp+" "); if (preLevelRule == null) { ExpNeed = curLevelRule.Exp; } else { ExpNeed = curLevelRule.Exp - preLevelRule.Exp; } DepartmentRulePB prevRule = GetRule(pb.Level - 1); if (prevRule == null) { Exp = pb.Exp; } else { Exp = pb.Exp - prevRule.Exp; } }