From c78665e4fd83a64a67a6747ec9429c74a3d4a466 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 20 Jun 2024 02:16:41 +0200 Subject: generate dot graph from recipes --- server/src/lib.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'server/src/lib.rs') 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(), + ) +} -- cgit v1.2.3-70-g09d2