Commit | Line | Data |
---|---|---|
4a2d6056 TW |
1 | package kaka.cakelight; |
2 | ||
03b67a73 TW |
3 | import java.util.function.Consumer; |
4 | ||
5 | public abstract class Mode { | |
6b569670 | 6 | private Consumer<LedFrame> frameListener; |
03b67a73 TW |
7 | |
8 | public abstract void enter(Configuration config); | |
9 | public abstract void exit(); | |
10 | ||
11 | public void setFrameListener(Consumer<LedFrame> listener) { | |
12 | frameListener = listener; | |
13 | } | |
6b569670 TW |
14 | |
15 | public void updateWithFrame(LedFrame frame) { | |
16 | assert frameListener != null; | |
17 | frameListener.accept(frame); | |
18 | } | |
4a2d6056 | 19 | } |