mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-12 00:40:08 +00:00
23 lines
341 B
C#
23 lines
341 B
C#
|
using System;
|
|||
|
|
|||
|
namespace QSB.Utility.VariableSync
|
|||
|
{
|
|||
|
internal class VariableReference<T>
|
|||
|
{
|
|||
|
private Func<T> _getter;
|
|||
|
private Action<T> _setter;
|
|||
|
|
|||
|
public VariableReference(Func<T> getter, Action<T> setter)
|
|||
|
{
|
|||
|
_getter = getter;
|
|||
|
_setter = setter;
|
|||
|
}
|
|||
|
|
|||
|
public T Value
|
|||
|
{
|
|||
|
get => _getter();
|
|||
|
set => _setter(value);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|