diff options
Diffstat (limited to 'server/src/lib.rs')
-rw-r--r-- | server/src/lib.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/server/src/lib.rs b/server/src/lib.rs index a326190d..2f677d7c 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -1,5 +1,16 @@ -pub mod game; -pub mod protocol; +use data::{build_gamedata, Gamedata}; +use std::fs::File; + +pub mod customer; pub mod data; +pub mod game; pub mod interaction; -pub mod customer; +pub mod protocol; + +pub fn load_gamedata() -> Gamedata { + build_gamedata( + serde_yaml::from_reader(File::open("data/recipes.yaml").unwrap()).unwrap(), + serde_yaml::from_reader(File::open("data/map.yaml").unwrap()).unwrap(), + serde_yaml::from_reader(File::open("data/demands.yaml").unwrap()).unwrap(), + ) +} |