feed `n` windows of `ms` / `wait` / `tok`; returns the last non-None action
| 29 | |
| 30 | // feed `n` windows of `ms` / `wait` / `tok`; returns the last non-None action |
| 31 | static Action feed(AdaptAsyncSelf& s, int n, double ms, double wait, int tok) { |
| 32 | Action last = Action::None; |
| 33 | for (int i = 0; i < n; ++i) { |
| 34 | const Action a = s.window(ms, wait, tok); |
| 35 | if (a != Action::None) last = a; |
| 36 | } |
| 37 | return last; |
| 38 | } |
| 39 | |
| 40 | int main() { |
| 41 | const char* why = nullptr; |