public bool LoadDict <T, U>(string key, out Dictionary <T, U> value) { ThrowExceptionWhenISaveable("It is forbidden to load a dictionary containing an `ISaveable`!", typeof(T), typeof(U)); if (LoadStruct(key, out SaveableDict <T, U> sdOld)) { value = SaveableDict <T, U> .To(sdOld); return(true); } else if (LoadStruct(key, out SaveableDict sdNew)) { value = SaveableDict.To <T, U>(sdNew); return(true); } value = null; return(false); }
public void SaveDict <T, U>(string key, Dictionary <T, U> value) { ThrowExceptionWhenISaveable("It is forbidden to save a dictionary containing an `ISaveable`!", typeof(T), typeof(U)); SaveStruct(key, SaveableDict.From(value)); }