aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/mod.rs')
-rw-r--r--src/state/mod.rs47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs
deleted file mode 100644
index 0fe9f40..0000000
--- a/src/state/mod.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-mod threads;
-
-use std::io::{Stdin, Write};
-use termion::event::Key;
-use termion::input::TermRead;
-
-pub use threads::Threads;
-
-pub struct Client {
- states: Vec<State>,
-}
-
-impl Client {
- pub fn new(initial_state: State) -> Self {
- Self {
- states: vec![initial_state],
- }
- }
-
- pub fn run<W: Write>(mut self, mut screen: W, stdin: Stdin) {
- for c in stdin.keys() {
- let c = c.unwrap();
- // Global keybinds
- match c {
- Key::Char('q') => {
- self.states.pop().unwrap();
- if self.states.is_empty() {
- break;
- }
- },
- _ => ()
- }
-
- let next_state = match self.states.last_mut().unwrap() {
- State::Threads(s) => s.tick(&mut screen, c),
- };
-
- if let Some(next_state) = next_state {
- self.states.push(next_state);
- }
- }
- }
-}
-
-pub enum State {
- Threads(Threads),
-}