public object Clone() { RewardItemData c = new RewardItemData(); c.rewardDate = rewardDate; c.rewardConfigId = rewardConfigId; c.rewardItemConfigId = rewardItemConfigId; return(c); }
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()); }