Move all modes to package kaka.cakelight.mode
[kaka/cakelight.git] / src / kaka / cakelight / mode / Mode.java
... / ...
CommitLineData
1package kaka.cakelight.mode;
2
3import kaka.cakelight.Configuration;
4import kaka.cakelight.LedFrame;
5
6import java.util.function.Consumer;
7
8public abstract class Mode {
9 private Consumer<LedFrame> frameListener;
10
11 public abstract void enter(Configuration config);
12 public abstract void exit();
13
14 public void setFrameListener(Consumer<LedFrame> listener) {
15 frameListener = listener;
16 }
17
18 public void updateWithFrame(LedFrame frame) {
19 assert frameListener != null;
20 frameListener.accept(frame);
21 }
22}