-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Mauran <[email protected]>
- Loading branch information
1 parent
356b249
commit 1943b31
Showing
7 changed files
with
99 additions
and
59 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use super::board::{Board, GameBoard}; | ||
use crate::pieces::{PieceColor, PieceMove}; | ||
|
||
pub struct Game { | ||
pub board: Board, | ||
pub move_history: Vec<PieceMove>, | ||
pub current_turn: PieceColor, | ||
pub is_king_checked: bool, | ||
pub is_king_checkmated: bool, | ||
pub is_stalemate: bool, | ||
pub is_draw: bool, | ||
pub is_game_over: bool, | ||
} | ||
|
||
impl Game { | ||
pub fn new() -> Self { | ||
Self { | ||
board: Board::default(), | ||
move_history: Vec::new(), | ||
current_turn: PieceColor::White, | ||
is_king_checked: false, | ||
is_king_checkmated: false, | ||
is_stalemate: false, | ||
is_draw: false, | ||
is_game_over: false, | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod board; | ||
pub mod game; |
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
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
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
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