Пример #1
0
        public object Clone()
        {
            RewardItemData c = new RewardItemData();

            c.rewardDate         = rewardDate;
            c.rewardConfigId     = rewardConfigId;
            c.rewardItemConfigId = rewardItemConfigId;

            return(c);
        }
Пример #2
0
        public bool ClaimReward(string rewardConfigId, string rewardItemConfigId)
        {
            RewardItemData newItem = new RewardItemData();

            newItem.rewardConfigId     = rewardConfigId;
            newItem.rewardItemConfigId = rewardItemConfigId;
            newItem.rewardDate         = serverTime.ToServerString(serverTime.GetLocalTime());

            //if this was claimed before, it means were looping so we need to clear the rewards list.
            if (_data.rewards.Any(item => item.rewardConfigId == rewardConfigId && item.rewardItemConfigId == rewardItemConfigId))
            {
                ResetRewards(rewardConfigId);
            }
            _data.rewards.Add(newItem);
            return(Save());
        }