aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/bin/graph.rs22
1 files changed, 16 insertions, 6 deletions
diff --git a/server/src/bin/graph.rs b/server/src/bin/graph.rs
index 9ff6f973..c52b1400 100644
--- a/server/src/bin/graph.rs
+++ b/server/src/bin/graph.rs
@@ -13,13 +13,13 @@ fn main() {
println!("i{i} [label=\"{}\"]", data.item_name(ItemIndex(i)))
}
for (RecipeIndex(ri), recipe) in data.recipes() {
+ let (kind, color) = match recipe {
+ Recipe::Passive { .. } => ("Passive", "#2bc493"),
+ Recipe::Active { .. } => ("Active", "#47c42b"),
+ Recipe::Instant { .. } => ("Instant", "#5452d8"),
+ };
println!(
- "r{ri} [label=\"{}\\non {}\" shape=box color=gray fillcolor=gray style=filled]",
- match recipe {
- Recipe::Passive { .. } => "Passive",
- Recipe::Active { .. } => "Active",
- Recipe::Instant { .. } => "Instant",
- },
+ "r{ri} [label=\"{kind}\\non {}\" shape=box color={color:?} fillcolor={color:?} style=filled]",
if let Some(tile) = recipe.tile() {
data.tile_name(tile)
} else {
@@ -34,5 +34,15 @@ fn main() {
}
}
+ for (di, d) in data.demands.iter().enumerate() {
+ let color = "#c4422b";
+ println!(
+ "d{di} [label=\"Demand\\ntakes {}s\" shape=box color={color:?} fillcolor={color:?} style=filled]",
+ d.duration
+ );
+ println!("i{} -> d{di}", d.from.0);
+ println!("d{di} -> i{}", d.to.0);
+ }
+
println!("}}");
}