示例#1
0
        private bool InitAllianceDonateChest(GM.DataCache.ConditionAlliance tbl)
        {
            if (tbl == null)
            {
                EB.Debug.LogError("InitAllianceDonateChest:tbl is null");
                return(false);
            }

            if (mDonateChestList == null)
            {
                mDonateChestList = new List <AllianceDonateChest>();
            }
            else
            {
                mDonateChestList.Clear();
            }
            for (int i = 0; i < tbl.DonateChestLength; i++)
            {
                AllianceDonateChest tpl = ParseAllianceDonateChest(tbl.GetDonateChest(i));
                if (tpl != null)
                {
                    mDonateChestList.Add(tpl);
                }
            }
            return(true);
        }
示例#2
0
        private AllianceDonateChest ParseAllianceDonateChest(GM.DataCache.DonateChest obj)
        {
            if (obj == null)
            {
                return(null);
            }
            AllianceDonateChest data = new AllianceDonateChest();

            data.id      = obj.Id;
            data.score   = obj.Score;
            data.Rewards = ParseShowItem(obj.Reward);
            return(data);
        }