mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[commands] Revert to original Trigger implementation (#4673)
Trigger was refactored to use BooleanEvent when it was introduced in #4104. This reverts to the original implementation until edge-based BooleanEvents can be fixed.
This commit is contained in:
@@ -20,13 +20,11 @@ class EventLoop {
|
||||
EventLoop& operator=(const EventLoop&) = delete;
|
||||
|
||||
/**
|
||||
* Bind a new action to run whenever the condition is true.
|
||||
* Bind a new action to run.
|
||||
*
|
||||
* @param condition the condition to listen to.
|
||||
* @param action the action to run.
|
||||
*/
|
||||
void Bind(std::function<bool()> condition,
|
||||
wpi::unique_function<void()> action);
|
||||
void Bind(wpi::unique_function<void()> action);
|
||||
|
||||
/**
|
||||
* Poll all bindings.
|
||||
@@ -39,12 +37,6 @@ class EventLoop {
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
struct Binding {
|
||||
std::function<bool()> condition;
|
||||
wpi::unique_function<void()> action;
|
||||
|
||||
void Poll();
|
||||
};
|
||||
std::vector<Binding> m_bindings;
|
||||
std::vector<wpi::unique_function<void()>> m_bindings;
|
||||
};
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user