-
Notifications
You must be signed in to change notification settings - Fork 30
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
6f968d6
commit 2507c0f
Showing
9 changed files
with
66 additions
and
45 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,30 @@ | ||
use uci::Engine; | ||
|
||
pub struct Bot { | ||
// the chess engine | ||
pub engine: Option<Engine>, | ||
/// Used to indicate if a bot move is following | ||
pub bot_will_move: bool, | ||
// if the bot is starting, meaning the player is black | ||
pub is_bot_starting: bool, | ||
} | ||
|
||
impl Default for Bot { | ||
fn default() -> Self { | ||
Self { | ||
engine: None, | ||
bot_will_move: false, | ||
is_bot_starting: false, | ||
} | ||
} | ||
} | ||
|
||
impl Bot { | ||
pub fn clone(&self) -> Self { | ||
Self { | ||
engine: self.engine.clone(), | ||
bot_will_move: self.bot_will_move, | ||
is_bot_starting: self.is_bot_starting, | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod board; | ||
pub mod bot; | ||
pub mod coord; | ||
pub mod game; | ||
pub mod game_board; | ||
|
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
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