Beispiel #1
0
 public GeneratorLocalData GetLocalData(int generatorId)
 {
     return(LocalData.ContainsKey(generatorId) ? LocalData[generatorId] : null);
 }
Beispiel #2
0
        //public void ResyncLocalData() => TriggerEvent("Session.UpdateLocalData", ServerID, JsonConvert.SerializeObject(LocalData));

        /// <summary>
        /// Gets the local data at the specified key if it exists
        /// </summary>
        /// <param name="key">Key of the entry you are wanting to get</param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public T GetLocalData <T>(string key, T defaultValue = default(T)) => LocalData.ContainsKey(key) ? (T)LocalData[key] : defaultValue;