using R3;
using UnityEngine;

namespace KitsuneCafe.SOAP
{
    public class ReactiveValue<T> : ReactiveSource<T>
    {
#if UNITY_EDITOR
        [Multiline]
        public string Description = "";
#endif

        [SerializeField]
        protected SerializableReactiveProperty<T> value;
        public T Value { get => value.Value; set { this.value.Value = value; } }

        public ReadOnlyReactiveProperty<T> AsReactiveProperty() => value;
        public override Observable<T> AsObservable() => value;
    }
}