debugging for intersections

This commit is contained in:
Dustin Carlino 2018-08-01 14:30:06 -07:00
parent 5ad6f53607
commit a4b8c2247f
2 changed files with 13 additions and 0 deletions

View File

@ -100,6 +100,14 @@ impl SelectionState {
false
}
}
SelectionState::SelectedIntersection(id) => {
if input.key_pressed(Key::D, "debug") {
map.get_i(*id).dump_debug();
true
} else {
false
}
}
_ => false,
};
if let Some(s) = new_state {

View File

@ -1,5 +1,6 @@
// Copyright 2018 Google LLC, licensed under http://www.apache.org/licenses/LICENSE-2.0
use abstutil;
use dimensioned::si;
use geom::Pt2D;
use std::collections::HashSet;
@ -43,4 +44,8 @@ impl Intersection {
}
roads.len() == 1
}
pub fn dump_debug(&self) {
println!("{}", abstutil::to_json(self));
}
}