public static int GetTimesGiven(string rewardId)
        {
            String key = KeyRewardTimesGiven(rewardId);
            String val = KeyValueStorage.GetValue(key);

            if (val == null)
            {
                return(0);
            }
            return(int.Parse(val));
        }
        public static long GetLastGivenTimeMillis(String rewardId)
        {
            String key = KeyRewardLastGiven(rewardId);
            String val = KeyValueStorage.GetValue(key);

            if (val == null)
            {
                return(0);
            }
            return(long.Parse(val));
        }
        /// <summary>
        /// Retrieves the index of the last reward given in a sequence of rewards.
        /// </summary>
        public static int GetLastSeqIdxGiven(string rewardId)
        {
            String key = KeyRewardIdxSeqGiven(rewardId);

            String val = KeyValueStorage.GetValue(key);

            if (val == null)
            {
                return(-1);
            }
            return(int.Parse(val));;
        }
        public static void ResetTimesGiven(String rewardId, int timesGiven)
        {
            String key = KeyRewardTimesGiven(rewardId);

            KeyValueStorage.SetValue(key, timesGiven.ToString());
        }
        public static void SetLastGivenTimeMillis(String rewardId, long lastGiven)
        {
            String key = KeyRewardLastGiven(rewardId);

            KeyValueStorage.SetValue(key, lastGiven.ToString());
        }
        public static void SetLastSeqIdxGiven(string rewardId, int idx)
        {
            String key = KeyRewardIdxSeqGiven(rewardId);

            KeyValueStorage.SetValue(key, idx.ToString());
        }