mirror of https://github.com/ppy/osu
Expose Live.Detach() method for ease of use
This commit is contained in:
parent
dd50b5870e
commit
d810af82ec
|
@ -68,6 +68,11 @@ private T getThreadLocalValue()
|
|||
/// </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 @@ public void PerformUpdate(Action<T> perform)
|
|||
}
|
||||
|
||||
public static implicit operator T?(Live<T>? wrapper)
|
||||
=> wrapper?.Get().Detach();
|
||||
=> wrapper?.Detach() ?? null;
|
||||
|
||||
public static implicit operator Live<T>(T obj) => obj.WrapAsUnmanaged();
|
||||
|
||||
|
|
Loading…
Reference in New Issue