Exemplo n.º 1
0
        public static int GetTimesGiven(string rewardId)
        {
            String key = KeyRewardTimesGiven(rewardId);
            String val = KeyValueStorage.GetValue(key);

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

            if (val == null)
            {
                return(0);
            }
            return(long.Parse(val));
        }
Exemplo n.º 3
0
        /// <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));;
        }
Exemplo n.º 4
0
        public static void ResetTimesGiven(String rewardId, int timesGiven)
        {
            String key = KeyRewardTimesGiven(rewardId);

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

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

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