Created
November 15, 2015 00:22
-
-
Save mpgarate/dc5d5fa62c042633c319 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
diff --git a/src/game/mod.rs b/src/game/mod.rs | |
index 61f833c..65105c3 100644 | |
--- a/src/game/mod.rs | |
+++ b/src/game/mod.rs | |
@@ -1,5 +1,8 @@ | |
pub use self::bitboard::BitBoard; | |
pub use self::position::Position; | |
+pub use self::state::GameState; | |
+ | |
mod bitboard; | |
mod position; | |
+mod state; | |
diff --git a/src/game/state.rs b/src/game/state.rs | |
new file mode 100644 | |
index 0000000..dadd51b | |
--- /dev/null | |
+++ b/src/game/state.rs | |
@@ -0,0 +1,27 @@ | |
+use game::bitboard::BitBoard; | |
+ | |
+pub struct GameState { | |
+ board: BitBoard | |
+} | |
+ | |
+impl GameState { | |
+ pub fn new() -> GameState { | |
+ GameState { board: BitBoard::new() } | |
+ } | |
+ | |
+ pub fn is_solved(&self) -> bool { | |
+ self.board.is_solved() | |
+ } | |
+} | |
+ | |
+#[cfg(test)] | |
+mod tests { | |
+ use super::*; | |
+ | |
+ #[test] | |
+ fn new_state_is_solved() { | |
+ let s: GameState = GameState::new(); | |
+ | |
+ assert!(s.is_solved()); | |
+ } | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment