Symlink/adapt shared code from frontend to backend
This commit is contained in:
parent
e4d4d6e153
commit
ec7f664c81
8 changed files with 23 additions and 0 deletions
7
back_end/Cargo.lock
generated
7
back_end/Cargo.lock
generated
|
@ -158,6 +158,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"bytes",
|
||||
"futures",
|
||||
"oorandom",
|
||||
"rand",
|
||||
"rusqlite",
|
||||
"serde_json",
|
||||
|
@ -574,6 +575,12 @@ version = "1.10.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
|
||||
|
||||
[[package]]
|
||||
name = "oorandom"
|
||||
version = "11.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
|
||||
|
||||
[[package]]
|
||||
name = "opaque-debug"
|
||||
version = "0.3.0"
|
||||
|
|
|
@ -13,3 +13,4 @@ bytes = "1.1"
|
|||
rusqlite = "0.27.0"
|
||||
rand = "0.8.4"
|
||||
futures = "0.3"
|
||||
oorandom = "11.1.3"
|
||||
|
|
1
back_end/src/ai.rs
Symbolic link
1
back_end/src/ai.rs
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../front_end/src/ai.rs
|
1
back_end/src/constants.rs
Symbolic link
1
back_end/src/constants.rs
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../front_end/src/constants.rs
|
1
back_end/src/game_logic.rs
Symbolic link
1
back_end/src/game_logic.rs
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../front_end/src/game_logic.rs
|
|
@ -1,5 +1,10 @@
|
|||
mod ai;
|
||||
mod constants;
|
||||
mod db_handler;
|
||||
mod game_logic;
|
||||
mod json_handlers;
|
||||
mod random_helper;
|
||||
mod state;
|
||||
|
||||
const SQLITE_DB_PATH: &str = "./fourLineDropper.db";
|
||||
|
||||
|
|
6
back_end/src/random_helper.rs
Normal file
6
back_end/src/random_helper.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
use oorandom::Rand32;
|
||||
use rand::prelude::*;
|
||||
|
||||
pub fn get_seeded_random() -> Result<Rand32, String> {
|
||||
Ok(Rand32::new(thread_rng().gen()))
|
||||
}
|
1
back_end/src/state.rs
Symbolic link
1
back_end/src/state.rs
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../front_end/src/state.rs
|
Loading…
Reference in a new issue