hellbound/Assets/Scripts/Core/Utils/ValueWrapper.cs

26 lines
376 B
C#
Raw Normal View History

2021-11-26 11:16:25 +03:00
using System;
public class ValueWrapper<T>
{
private readonly Func<T> _get;
private readonly Action<T> _set;
public ValueWrapper(Func<T> get, Action<T> set)
{
_get = get;
_set = set;
}
public T Value
{
get
{
return _get();
}
set
{
_set(value);
}
}
}