diff options
Diffstat (limited to 'src/minesweeper.rs')
-rw-r--r-- | src/minesweeper.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/minesweeper.rs b/src/minesweeper.rs index c81aa09..a494b94 100644 --- a/src/minesweeper.rs +++ b/src/minesweeper.rs @@ -3,6 +3,8 @@ use std::{ num::NonZeroUsize, }; use rand::{ thread_rng, Rng, distributions::Uniform }; +use serde::Serialize; + const HIDDEN_BIT: u8 = 1 << 7; pub const FLAGGED_BIT: u8 = 1 << 6; const CORRECT_BIT: u8 = 1 << 5; // grading for a rightly flagged mine @@ -29,7 +31,7 @@ pub struct Game { pub board_conf: BoardConf, } -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Serialize)] pub struct BoardConf { pub w: NonZeroUsize, pub h: NonZeroUsize, |