2022-11-13 18:07:54 +03:00
|
|
|
using System;
|
2022-03-08 10:13:27 +03:00
|
|
|
|
|
|
|
namespace Syntriax.Modules.Movement.State
|
|
|
|
{
|
|
|
|
public class MemberToggleState : IToggleState
|
|
|
|
{
|
|
|
|
private bool _enabled = true;
|
|
|
|
|
|
|
|
public bool Toggled
|
|
|
|
{
|
|
|
|
get => _enabled;
|
|
|
|
set
|
|
|
|
{
|
|
|
|
bool isNewValue = _enabled != value;
|
|
|
|
|
|
|
|
_enabled = value;
|
|
|
|
|
|
|
|
if (isNewValue)
|
|
|
|
OnToggleStateChanged.Invoke(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-13 18:07:54 +03:00
|
|
|
public Action<bool> OnToggleStateChanged { get; set; } = null;
|
2022-03-08 10:13:27 +03:00
|
|
|
}
|
|
|
|
}
|