mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-25 11:44:25 +03:00
small refactor btwn sandbox and abtest mode
This commit is contained in:
parent
05b953d639
commit
419017a295
@ -1,9 +1,7 @@
|
||||
mod score;
|
||||
pub mod setup;
|
||||
|
||||
use crate::common::{
|
||||
time_controls, AgentTools, CommonState, RouteExplorer, SpeedControls, TripExplorer,
|
||||
};
|
||||
use crate::common::{time_controls, AgentTools, CommonState, SpeedControls};
|
||||
use crate::debug::DebugMode;
|
||||
use crate::game::{State, Transition};
|
||||
use crate::render::MIN_ZOOM_FOR_DETAIL;
|
||||
@ -136,13 +134,6 @@ impl State for ABTestMode {
|
||||
)));
|
||||
}
|
||||
|
||||
if let Some(explorer) = RouteExplorer::new(ctx, ui) {
|
||||
return Transition::Push(Box::new(explorer));
|
||||
}
|
||||
if let Some(explorer) = TripExplorer::new(ctx, ui) {
|
||||
return Transition::Push(Box::new(explorer));
|
||||
}
|
||||
|
||||
if let Some(t) = self.primary_agent_tools.event(ctx, ui, &mut self.menu) {
|
||||
return t;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::common::route_viewer::RouteViewer;
|
||||
use crate::common::ColorLegend;
|
||||
use crate::common::{ColorLegend, RouteExplorer, TripExplorer};
|
||||
use crate::game::{Transition, WizardState};
|
||||
use crate::render::{AgentColorScheme, MIN_ZOOM_FOR_DETAIL};
|
||||
use crate::ui::UI;
|
||||
@ -109,6 +109,13 @@ impl AgentTools {
|
||||
))));
|
||||
}
|
||||
|
||||
if let Some(explorer) = RouteExplorer::new(ctx, ui) {
|
||||
return Some(Transition::Push(Box::new(explorer)));
|
||||
}
|
||||
if let Some(explorer) = TripExplorer::new(ctx, ui) {
|
||||
return Some(Transition::Push(Box::new(explorer)));
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,7 @@ mod spawner;
|
||||
mod time_travel;
|
||||
mod trip_stats;
|
||||
|
||||
use crate::common::{
|
||||
time_controls, AgentTools, CommonState, RouteExplorer, SpeedControls, TripExplorer,
|
||||
};
|
||||
use crate::common::{time_controls, AgentTools, CommonState, SpeedControls};
|
||||
use crate::debug::DebugMode;
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::{State, Transition, WizardState};
|
||||
@ -114,12 +112,6 @@ impl State for SandboxMode {
|
||||
if let Some(new_state) = spawner::AgentSpawner::new(ctx, ui, &mut self.menu) {
|
||||
return Transition::Push(new_state);
|
||||
}
|
||||
if let Some(explorer) = RouteExplorer::new(ctx, ui) {
|
||||
return Transition::Push(Box::new(explorer));
|
||||
}
|
||||
if let Some(explorer) = TripExplorer::new(ctx, ui) {
|
||||
return Transition::Push(Box::new(explorer));
|
||||
}
|
||||
|
||||
if let Some(t) = self.agent_tools.event(ctx, ui, &mut self.menu) {
|
||||
return t;
|
||||
|
Loading…
Reference in New Issue
Block a user