1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:58:21 +08:00

Expose Live.Detach() method for ease of use

This commit is contained in:
Dean Herbert 2021-01-11 19:28:07 +09:00
parent dd50b5870e
commit d810af82ec

View File

@ -68,6 +68,11 @@ namespace osu.Game.Database
/// </summary>
public T Get() => threadValues.Value;
/// <summary>
/// Retrieve a detached copy of the data.
/// </summary>
public T Detach() => Get().Detach();
/// <summary>
/// Wrap a property of this instance as its own live access object.
/// </summary>
@ -88,7 +93,7 @@ namespace osu.Game.Database
}
public static implicit operator T?(Live<T>? wrapper)
=> wrapper?.Get().Detach();
=> wrapper?.Detach() ?? null;
public static implicit operator Live<T>(T obj) => obj.WrapAsUnmanaged();