/// <summary> /// Whether there is a value stored for the key. /// </summary> /// <param name="saveKey">The key.</param> /// <returns>Whether there is a value stored.</returns> public bool HasValue <T>(SaveKey <T> saveKey) { return(HasValue(saveKey.Name)); }
/// <summary> /// Retrieve a value from the store, using a typed key. The value will be returned in the correct type, using /// the save key. If the value is not present then the default value for the type will be returned. However, if /// there is a value stored for that key of a different type, then an exception will be thrown. /// </summary> /// <param name="saveKey">The typed key to retrieve the value for.</param> /// <returns>The stored value.</returns> public T GetValue <T>(SaveKey <T> saveKey) { return(GetValue <T>(saveKey.Name)); }
/// <summary> /// Store a value into the store for the provided save key. Afterwards a value changed event will be thrown. /// </summary> /// <param name="saveKey">The key to store the value for.</param> /// <param name="saveValue">The value to store.</param> public void SetValue <T>(SaveKey <T> saveKey, T saveValue) { SetValue(saveKey.Name, saveValue); }
/// <summary> /// Retrieve an accessor for a particular typed key. Through this accessor you will be able to get the stored /// value, set a new stored value and save all values. /// </summary> /// <returns>An accessor for a particular typed key.</returns> public SaveValueAccessor <T> GetAccessor <T>(SaveKey <T> saveKey) { return(new SaveValueAccessor <T>(saveKey, this)); }