diff --git a/src/main.rs b/src/main.rs index 9994563..858caa4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use std::{io, time::Duration}; fn main() { let mut screen = Ui::init(io::stdout()); let mut state = State::init(Difficulty::Mid); - screen.draw_board().or_crash(); + screen.draw_static_elements().or_crash(); loop { if poll(Duration::from_millis(250)).unwrap_or(false) { diff --git a/src/ui.rs b/src/ui.rs index be59f85..6f6c6b5 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -87,7 +87,7 @@ where if old_dimensions != (self.width, self.height) { self.clear()?; - self.draw_board()?; + self.draw_static_elements()?; } Ok(()) @@ -105,8 +105,8 @@ where /// changes to `self.ostream`. /// /// NOTE: this function does not draw the static elements of the ui - /// using `Ui::draw_board()`. for efficiency these are only - /// redrawn on screen dimensions changes. + /// using `Ui::draw_static_elements()`. for efficiency these are only + /// redrawn on screen dimensions changes and initialization. pub fn draw(&mut self, state: &State) -> io::Result<()> { self.update_dimensions()?; @@ -123,7 +123,7 @@ where /// /// NOTE: this function itself does not flush to `self.ostream` /// in order to only have to flush once per frame. - pub fn draw_board(&mut self) -> io::Result<()> { + pub fn draw_static_elements(&mut self) -> io::Result<()> { self.init_cursor_offset()?; queue!(self.ostream, SetForegroundColor(Color::Reset))?; queue!(self.ostream, SetBackgroundColor(Color::Reset))?;