diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-08 23:33:59 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-08 23:33:59 +0200 |
| commit | c768cd1240c272dad34f07b09340cfe1d11d67b6 (patch) | |
| tree | 7a422e56ee6874a44aa5edba018cf0e902058db3 /server/tools/src | |
| parent | b8af9f80385fa4d38bc2ac2109250fa9ea2a8080 (diff) | |
| download | hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar.bz2 hurrycurry-c768cd1240c272dad34f07b09340cfe1d11d67b6.tar.zst | |
merge all makefiles into one
Diffstat (limited to 'server/tools/src')
| -rw-r--r-- | server/tools/src/graph.rs | 3 | ||||
| -rw-r--r-- | server/tools/src/graph_summary.rs | 3 | ||||
| -rw-r--r-- | server/tools/src/main.rs | 15 | ||||
| -rw-r--r-- | server/tools/src/map_linter.rs | 3 |
4 files changed, 8 insertions, 16 deletions
diff --git a/server/tools/src/graph.rs b/server/tools/src/graph.rs index a65ffc97..343047da 100644 --- a/server/tools/src/graph.rs +++ b/server/tools/src/graph.rs @@ -20,8 +20,7 @@ use hurrycurry_data::index::DataIndex; use hurrycurry_protocol::{Demand, ItemIndex, Recipe, RecipeIndex}; pub(crate) fn graph() -> Result<()> { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; println!("digraph {{"); diff --git a/server/tools/src/graph_summary.rs b/server/tools/src/graph_summary.rs index bfdcc955..c6db2678 100644 --- a/server/tools/src/graph_summary.rs +++ b/server/tools/src/graph_summary.rs @@ -22,8 +22,7 @@ use hurrycurry_protocol::{ItemIndex, Recipe, TileIndex}; use std::collections::HashSet; pub(crate) fn graph_summary() -> Result<()> { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; println!("digraph {{"); diff --git a/server/tools/src/main.rs b/server/tools/src/main.rs index 07c5d45b..4af6b87f 100644 --- a/server/tools/src/main.rs +++ b/server/tools/src/main.rs @@ -65,8 +65,7 @@ fn main() -> Result<()> { Action::Graph => graph()?, Action::GraphSummary => graph_summary()?, Action::GraphSingle { out, dot_out } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, serverdata) = index.generate("5star")?; let out = data.get_item_by_name(&out).unwrap(); let mut diagram = recipe_diagram(&data, &serverdata, &[out])?; @@ -79,24 +78,21 @@ fn main() -> Result<()> { println!("{out}"); } Action::MapDemands { map } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, _) = index.generate(&map)?; for demand in &data.demands { println!("{}", data.item_name(demand.input)) } } Action::MapItems { map } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, _) = index.generate(&map)?; for name in &data.item_names { println!("{name}") } } Action::MapTiles { map } => { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, _) = index.generate(&map)?; for name in &data.tile_names { println!("{name}") @@ -104,8 +100,7 @@ fn main() -> Result<()> { } Action::CheckMap { map } => { if map == "all" { - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; for map in index.maps.keys() { check_map(map)?; } diff --git a/server/tools/src/map_linter.rs b/server/tools/src/map_linter.rs index 678f2930..94b57726 100644 --- a/server/tools/src/map_linter.rs +++ b/server/tools/src/map_linter.rs @@ -146,8 +146,7 @@ static TILE_MODE: LazyLock<HashMap<String, TileMode>> = LazyLock::new(|| { pub fn check_map(map: &str) -> Result<()> { let style = &COLORED; let locale = &*FALLBACK_LOCALE; - let mut index = DataIndex::default(); - index.reload()?; + let index = DataIndex::new("data".into())?; let (data, serverdata) = index.generate(map)?; let mut warnings = Vec::new(); |