generated from Common-Games/Template.UnityPackage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathISavedValue.cs
37 lines (29 loc) · 1.07 KB
/
ISavedValue.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using JetBrains.Annotations;
namespace CGTK.Utils.Extensions.CGPlayerPrefs
{
using static PackageConstants;
/// <summary>
/// Abstract class describing a PlayerPrefs values
/// </summary>
///
/// <typeparam name="T">Type of the stored object</typeparam>
[PublicAPI]
public interface ISavedValue<T>
{
/// <summary> Gets or Sets the object from PlayerPrefs. </summary>
public abstract T Value { get; set; }
/// <summary> Delete the object from PlayerPrefs. </summary>
public abstract void Delete();
/// <summary> Whether the PlayerPref value is set. </summary>
public abstract Boolean IsSet { get; }
/// <summary> Reads the object from PlayerPrefs </summary>
///
/// <returns> The high-level object </returns>
public abstract T Read();
/// <summary> Writes the object to PlayerPrefs </summary>
///
/// <param name="value"> The high-level object </param>
public abstract void Write(in T value);
}
}