diff options
author | Katharina Fey <kookie@spacekookie.de> | 2021-02-06 19:40:53 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2021-02-06 19:42:04 +0100 |
commit | cf9392a33bb99ae581f818d3ddb8be1231521a02 (patch) | |
tree | 8295d8a4ed199c3263eadd8f1a508b98567a44f7 /games/rstnode/rst-core/src/mapstore.rs | |
parent | 56d96b2f22bf6a61ff992b000215dc3a2c2448ad (diff) |
rstnode: restructure project into workspace and sub-crates
Diffstat (limited to 'games/rstnode/rst-core/src/mapstore.rs')
-rw-r--r-- | games/rstnode/rst-core/src/mapstore.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/games/rstnode/rst-core/src/mapstore.rs b/games/rstnode/rst-core/src/mapstore.rs new file mode 100644 index 000000000000..85c5e36ef93b --- /dev/null +++ b/games/rstnode/rst-core/src/mapstore.rs @@ -0,0 +1,17 @@ +//! Map store + +use crate::config::MapCfg; +use std::{collections::BTreeMap, fs, path::Path}; + +pub struct MapStore { + configs: BTreeMap<String, MapCfg>, +} + +impl MapStore { + /// Load a set of map configs + pub fn load_path(&mut self, path: &Path) { + fs::read_dir(&path).unwrap().for_each(|d| { + let name = d.unwrap().file_name().into_string().unwrap(); + }); + } +} |