From a4b8c2247fc8a8976061cd0002eb5fbbd81a80fd Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Wed, 1 Aug 2018 14:30:06 -0700 Subject: [PATCH] debugging for intersections --- editor/src/plugins/selection.rs | 8 ++++++++ map_model/src/intersection.rs | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/editor/src/plugins/selection.rs b/editor/src/plugins/selection.rs index 82742628bf..091fc84516 100644 --- a/editor/src/plugins/selection.rs +++ b/editor/src/plugins/selection.rs @@ -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 { diff --git a/map_model/src/intersection.rs b/map_model/src/intersection.rs index 08de4ee077..82521dbefa 100644 --- a/map_model/src/intersection.rs +++ b/map_model/src/intersection.rs @@ -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)); + } }