small refactor btwn sandbox and abtest mode

This commit is contained in:
Dustin Carlino 2019-10-11 14:01:56 -07:00
parent 05b953d639
commit 419017a295
3 changed files with 10 additions and 20 deletions

View File

@ -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;
}

View File

@ -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
}

View File

@ -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;