Created
March 22, 2017 16:22
-
-
Save ssube/aac98303acda7d3c309217c84d26cb1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this._interval = Observable.interval(1000 / 20).timeInterval(); | |
this._screen.realloc(); | |
let state = 0; | |
const bufferInput = this._input.getStream().buffer(this._interval); | |
const frames: Observable<Frame> = this._interval.combineLatest(bufferInput).map((value) => { | |
return { | |
actions: value[1], | |
time: value[0] | |
}; | |
}); | |
frames.subscribe((frame) => { | |
this._log.debug({frame}, 'frame tick'); | |
let next = false; | |
let prev = false; | |
for (const action of frame.actions) { | |
switch (action.command) { | |
case Command.BaseMenu: | |
complete(); | |
// ... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment