private AllianceWarReward ParseWarRewardInfo(GM.DataCache.AllianceWarReward obj) { if (obj == null) { return(null); } AllianceWarReward tp1 = new AllianceWarReward(); tp1.Result = obj.Result; tp1.Stage = obj.Stage; tp1.Rewards = new List <LTShowItemData>(); if (!string.IsNullOrEmpty(obj.ItemId1)) { tp1.Rewards.Add(new LTShowItemData(obj.ItemId1, obj.ItemNum1, obj.ItemType1, false)); } if (!string.IsNullOrEmpty(obj.ItemId2)) { tp1.Rewards.Add(new LTShowItemData(obj.ItemId2, obj.ItemNum2, obj.ItemType2, false)); } if (!string.IsNullOrEmpty(obj.ItemId3)) { tp1.Rewards.Add(new LTShowItemData(obj.ItemId3, obj.ItemNum3, obj.ItemType3, false)); } if (!string.IsNullOrEmpty(obj.ItemId4)) { tp1.Rewards.Add(new LTShowItemData(obj.ItemId4, obj.ItemNum4, obj.ItemType4, false)); } return(tp1); }
public AllianceWarReward GetWarReward(int stage, int result) { AllianceWarReward tp = new AllianceWarReward(); for (int i = 0; i < mWarRewardList.Count; i++) { if (mWarRewardList[i].Stage == stage && mWarRewardList[i].Result == result) { tp = mWarRewardList[i]; } } return(tp); }
private bool InitAllianceWarReward(GM.DataCache.ConditionAlliance tbl) { if (tbl == null) { EB.Debug.LogError("InitAllianceWarReward:tbl is null"); return(false); } mWarRewardList = new List <AllianceWarReward>(); for (int i = 0; i < tbl.AllianceWarRewardLength; i++) { AllianceWarReward tpl = ParseWarRewardInfo(tbl.GetAllianceWarReward(i)); if (tpl != null) { mWarRewardList.Add(tpl); } } return(true); }