1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-11-23 19:42:51 +01:00
Minecraft-Phantom-Panel/Utils/Phantom.Utils.Events/SimpleObservableState.cs
2023-12-05 14:27:55 +01:00

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;
}
}