couple together crosswalks in stop sign editor

This commit is contained in:
Dustin Carlino 2018-12-05 10:59:56 -08:00
parent 636eb1fb1c
commit 546213e82b
2 changed files with 9 additions and 5 deletions

View File

@ -48,7 +48,7 @@
- move map_model geometry stuff elsewhere (sim stuff also needs it though)
- better drawing
- detailed turns, like https://i.ytimg.com/vi/NH6R3RH_ZDY/maxresdefault.jpg
- bezier turns for lane markings, turn icons, agent turn signals?
- rooftops
- https://thumbs.dreamstime.com/b/top-view-city-street-asphalt-transport-people-walking-down-sidewalk-intersecting-road-pedestrian-81034411.jpg
- https://thumbs.dreamstime.com/z/top-view-city-seamless-pattern-streets-roads-houses-cars-68652655.jpg

View File

@ -25,12 +25,16 @@ impl ControlStopSign {
self.turns[&turn]
}
pub fn set_priority(&mut self, turn: TurnID, priority: TurnPriority, map: &Map) {
assert_ne!(self.turns[&turn], priority);
pub fn set_priority(&mut self, t: TurnID, priority: TurnPriority, map: &Map) {
assert_ne!(self.turns[&t], priority);
if priority == TurnPriority::Priority {
assert!(self.could_be_priority_turn(turn, map));
assert!(self.could_be_priority_turn(t, map));
}
self.turns.insert(t, priority);
let turn = map.get_t(t);
if turn.turn_type == TurnType::Crosswalk {
self.turns.insert(turn.other_crosswalk_id(), priority);
}
self.turns.insert(turn, priority);
}
pub fn could_be_priority_turn(&self, id: TurnID, map: &Map) -> bool {