-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This uses duplicate MoveTables to circumvent the "use of moved value" issue that move closures love to cause. It's a very hacky workaround, but it's a constant-time cost, and only when the GUI sends a request to look for a move.
- Loading branch information
1 parent
a51cd4c
commit c7c8c67
Showing
4 changed files
with
93 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
use vampirc_uci::UciMove; | ||
|
||
use crate::{gamemanager::GameManager, movetable::{noarc::NoArc, MoveTable}}; | ||
use crate::{ | ||
gamemanager::GameManager, | ||
movetable::{noarc::NoArc, MoveTable}, | ||
}; | ||
|
||
pub struct Engine { | ||
pub tbl: NoArc<MoveTable>, | ||
pub move_history: Vec<UciMove>, | ||
pub board: GameManager, | ||
//pub set_new_game: bool, | ||
} | ||
|
||
impl Default for Engine { | ||
fn default() -> Self { | ||
Self { | ||
tbl: NoArc::new(MoveTable::default()), | ||
move_history: Vec::new(), | ||
board: GameManager::default(), | ||
} | ||
} | ||
} |
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