mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-23 19:42:51 +01:00
21 lines
402 B
C#
21 lines
402 B
C#
using Serilog;
|
|
|
|
namespace Phantom.Utils.Events;
|
|
|
|
public sealed class SimpleObservableState<T> : ObservableState<T> {
|
|
public T Value { get; private set; }
|
|
|
|
public SimpleObservableState(ILogger logger, T initialValue) : base(logger) {
|
|
this.Value = initialValue;
|
|
}
|
|
|
|
public void SetTo(T newValue) {
|
|
this.Value = newValue;
|
|
Update();
|
|
}
|
|
|
|
protected override T GetData() {
|
|
return Value;
|
|
}
|
|
}
|