mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-09-30 23:02:48 +02:00
17 lines
346 B
C#
17 lines
346 B
C#
using Serilog;
|
|
|
|
namespace Phantom.Utils.Events;
|
|
|
|
public sealed class SimpleObservableState<T>(ILogger logger, T initialValue) : ObservableState<T>(logger) {
|
|
public T Value { get; private set; } = initialValue;
|
|
|
|
public void SetTo(T newValue) {
|
|
this.Value = newValue;
|
|
Update();
|
|
}
|
|
|
|
protected override T GetData() {
|
|
return Value;
|
|
}
|
|
}
|