diff options
| author | tslil clingman <> | 2020-01-23 21:14:28 -0800 |
|---|---|---|
| committer | tslil clingman <> | 2020-01-23 21:36:26 -0800 |
| commit | 1930b067982a5ee324cd2832ace295e67603d2dc (patch) | |
| tree | 8d2f75aad21b73fd6f3aa8a81a84ba5cf3c4c5b0 /src/main.rs | |
| parent | 12be9c779da86a4e68ac69819bf22e351172c948 (diff) | |
First draft of win checking
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index ff98d41..263997f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,7 +36,7 @@ fn main() { let board_bottom = (size * cell_height + 3) as i32; let board_right = (size * cell_width + hoff + 3) as i32; - let board_gui = BoardGUI::new( + let mut board_gui = BoardGUI::new( 0, 0, size, @@ -94,9 +94,13 @@ fn main() { )); match game.perform_action(act) { Err(e) => message_log.log_error(e), - Ok(pos_vec) => { + Ok((pos_vec, win)) => { board_gui.update(&game, pos_vec); game_log.update(&game); + if let Some(w) = win { + message_log.log_message(format!("{}", w)); + break; + } } } } @@ -104,6 +108,6 @@ fn main() { action_entry.clear_entry_area(); } - // board_gui.read_action(); - // endwin(); + board_gui.read_action(); + endwin(); } |
