feat: Added Map

- Implemented Map
- Partially implemented CLI interaction with map
- Added load_map test
This commit is contained in:
Alexey 2025-12-03 17:01:40 +03:00
commit b9f75e426c
6 changed files with 371 additions and 25 deletions

View file

@ -171,7 +171,7 @@ impl Config {
out_vec
}
/// Returns full path to quests folder
/// Returns full path to accounts folder
/// This path will be relative to $PWD, not to config.
///
/// # Examples
@ -237,4 +237,29 @@ impl Config {
out_vec
}
/// Returns full path to map.toml
/// This path will be relative to $PWD, not to config.
///
/// # Examples
/// ```rust
/// use squad_quest::{config::Config,error::Error,map::Map,SquadObject};
/// # fn main() {
/// # let _ = wrapper();
/// # }
/// # fn wrapper() -> Result<(),Error> {
///
/// let path = "cfg/config.toml".into();
/// let config = Config::load(path);
///
/// let map_path = config.full_map_path();
/// let map = Map::load(map_path)?;
/// # Ok(())
/// # }
/// ```
pub fn full_map_path(&self) -> PathBuf {
let mut path = self.path.clone();
path.push(self.map.clone());
path
}
}