mirror of
https://github.com/a-b-street/abstreet.git
synced 2025-01-01 10:57:17 +03:00
cleanup crate dependencies, fix spawning car from lane, reduce
mutability of debug_car
This commit is contained in:
parent
11c549331e
commit
f6a6bb888e
@ -8,7 +8,6 @@ edition = "2018"
|
|||||||
aabb-quadtree = "0.1.0"
|
aabb-quadtree = "0.1.0"
|
||||||
abstutil = { path = "../abstutil" }
|
abstutil = { path = "../abstutil" }
|
||||||
counter = "0.4.3"
|
counter = "0.4.3"
|
||||||
derivative = "1.0.0"
|
|
||||||
derive-new = "0.5.6"
|
derive-new = "0.5.6"
|
||||||
downcast = "0.9.2"
|
downcast = "0.9.2"
|
||||||
ezgui = { path = "../ezgui" }
|
ezgui = { path = "../ezgui" }
|
||||||
@ -17,14 +16,11 @@ geo = "0.11.0"
|
|||||||
geom = { path = "../geom" }
|
geom = { path = "../geom" }
|
||||||
kml = { path = "../kml" }
|
kml = { path = "../kml" }
|
||||||
map_model = { path = "../map_model" }
|
map_model = { path = "../map_model" }
|
||||||
multimap = "0.4.0"
|
|
||||||
ordered-float = "1.0.1"
|
ordered-float = "1.0.1"
|
||||||
pretty_assertions = "0.5.1"
|
pretty_assertions = "0.5.1"
|
||||||
quick-xml = "0.13.1"
|
|
||||||
# TODO Just for the DES model prototype
|
# TODO Just for the DES model prototype
|
||||||
rand = "0.6.5"
|
rand = "0.6.5"
|
||||||
rand_xorshift = "0.1.1"
|
rand_xorshift = "0.1.1"
|
||||||
rayon = "1.0"
|
|
||||||
serde = "1.0.87"
|
serde = "1.0.87"
|
||||||
serde_derive = "1.0.87"
|
serde_derive = "1.0.87"
|
||||||
sim = { path = "../sim" }
|
sim = { path = "../sim" }
|
||||||
|
@ -33,7 +33,7 @@ impl ID {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn debug(&self, map: &Map, sim: &mut Sim, draw_map: &DrawMap) {
|
pub fn debug(&self, map: &Map, sim: &Sim, draw_map: &DrawMap) {
|
||||||
match *self {
|
match *self {
|
||||||
ID::Road(id) => {
|
ID::Road(id) => {
|
||||||
map.get_r(id).dump_debug();
|
map.get_r(id).dump_debug();
|
||||||
|
@ -42,11 +42,7 @@ impl AmbientPlugin for DebugObjectsState {
|
|||||||
|
|
||||||
if let Some(id) = self.selected {
|
if let Some(id) = self.selected {
|
||||||
if ctx.input.contextual_action(Key::D, "debug") {
|
if ctx.input.contextual_action(Key::D, "debug") {
|
||||||
id.debug(
|
id.debug(&ctx.primary.map, &ctx.primary.sim, &ctx.primary.draw_map);
|
||||||
&ctx.primary.map,
|
|
||||||
&mut ctx.primary.sim,
|
|
||||||
&ctx.primary.draw_map,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ use crate::objects::{DrawCtx, ID};
|
|||||||
use crate::plugins::{BlockingPlugin, PluginCtx};
|
use crate::plugins::{BlockingPlugin, PluginCtx};
|
||||||
use abstutil::Timer;
|
use abstutil::Timer;
|
||||||
use ezgui::{Color, GfxCtx, Key};
|
use ezgui::{Color, GfxCtx, Key};
|
||||||
use geom::Distance;
|
|
||||||
use map_model::{
|
use map_model::{
|
||||||
BuildingID, IntersectionID, IntersectionType, LaneType, PathRequest, Pathfinder, Position,
|
BuildingID, IntersectionID, IntersectionType, LaneType, PathRequest, Pathfinder, Position,
|
||||||
Trace, LANE_THICKNESS,
|
Trace, LANE_THICKNESS,
|
||||||
@ -65,7 +64,7 @@ impl SpawnAgent {
|
|||||||
.contextual_action(Key::F3, "spawn an agent starting here")
|
.contextual_action(Key::F3, "spawn an agent starting here")
|
||||||
{
|
{
|
||||||
return Some(SpawnAgent {
|
return Some(SpawnAgent {
|
||||||
from: Source::Driving(Position::new(id, Distance::ZERO)),
|
from: Source::Driving(Position::new(id, map.get_l(id).length() / 2.0)),
|
||||||
maybe_goal: None,
|
maybe_goal: None,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ impl Sim {
|
|||||||
self.driving.debug_car(id);
|
self.driving.debug_car(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn debug_intersection(&mut self, id: IntersectionID, map: &Map) {
|
pub fn debug_intersection(&self, id: IntersectionID, map: &Map) {
|
||||||
self.intersections.debug(id, map);
|
self.intersections.debug(id, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user