Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Trigger
- {
- private bool _value;
- public bool Value
- {
- get
- {
- bool value = _value;
- if (_value)
- _value = false;
- return value;
- }
- }
- public Trigger(bool startValue = false) =>
- _value = startValue;
- public void Set() => _value = true;
- public void Reset() => _value = false;
- public static implicit operator bool(Trigger trigger)
- => trigger.Value;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement