-
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.
- Loading branch information
Showing
7 changed files
with
103 additions
and
62 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,21 +1,13 @@ | ||
use crate::game::game; | ||
use crate::game::game_state::GameResult; | ||
|
||
use super::board::Tile; | ||
use super::game_state::{GameConfig, Move}; | ||
use super::game_state::{Game, GameConfig, Move}; | ||
|
||
pub(crate) fn initialize_game( | ||
script_1: &str, | ||
script_2: &str, | ||
config: GameConfig, | ||
) -> (GameResult, Vec<Vec<Tile>>, Vec<Move>) { | ||
let std = | ||
std::fs::read_to_string("../scripts/std.lua").expect("Could not load standard library"); | ||
|
||
let mut game_session = game::new(std, config); | ||
return game::start( | ||
&mut game_session, | ||
script_1.to_string(), | ||
script_2.to_string(), | ||
); | ||
let mut game_session = Game::new(config); | ||
return game_session.start(script_1.to_string(), script_2.to_string()); | ||
} |
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,2 +1 @@ | ||
pub(crate) mod sandbox_executor; | ||
pub(crate) mod terminate_thread; |
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