コード例 #1
0
        /// <summary>
        /// Returns an int from the savedata, returns the defaultValue when there's none
        /// </summary>
        public int GetInt(string key, int defaultValue = 0)
        {
            if (!IntStore.ContainsKey(key))
            {
                IntStore.Add(key, defaultValue);
            }

            return(IntStore[key]);
        }
コード例 #2
0
 /// <summary>
 /// Sets an int to the savedata
 /// </summary>
 public void SetInt(string key, int i)
 {
     if (!IntStore.ContainsKey(key))
     {
         IntStore.Add(key, i);
     }
     else
     {
         IntStore[key] = i;
     }
 }