Files
hoodFieldOfView/头罩视野slove/头罩视野/Services/BoolSign.cs

29 lines
612 B
C#
Raw Normal View History

2026-04-18 18:14:12 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace .Services
{
public class BoolSignal
{
private bool _previousValue;
public event Action OnRisingEdge;
// bool value = true;
public bool Value { get; set; }
public void CheckRisingEdge()
{
if (Value && !_previousValue)
{
OnRisingEdge?.Invoke();
}
_previousValue = Value;
}
}
}