Struct map_gui::simple_app::SimpleApp [−][src]
pub struct SimpleApp<T> { pub map: Map, pub draw_map: DrawMap, pub cs: ColorScheme, pub opts: Options, pub current_selection: Option<ID>, pub session: T, pub time: Time, }
Simple app state that just renders a static map, without any dynamic agents on the map.
Fields
map: Map
draw_map: DrawMap
cs: ColorScheme
opts: Options
current_selection: Option<ID>
session: T
Custom per-app state can be stored here
time: Time
If desired, this can be advanced to render traffic signals changing.
Implementations
impl<T: 'static> SimpleApp<T>
[src]
impl<T: 'static> SimpleApp<T>
[src]pub fn new<F: 'static + Fn(&mut EventCtx<'_>, &mut SimpleApp<T>) -> Vec<Box<dyn State<SimpleApp<T>>>>>(
ctx: &mut EventCtx<'_>,
opts: Options,
session: T,
init_states: F
) -> (SimpleApp<T>, Vec<Box<dyn State<SimpleApp<T>>>>)
[src]
ctx: &mut EventCtx<'_>,
opts: Options,
session: T,
init_states: F
) -> (SimpleApp<T>, Vec<Box<dyn State<SimpleApp<T>>>>)
pub fn draw_unzoomed(&self, g: &mut GfxCtx<'_>)
[src]
pub fn draw_zoomed(&self, g: &mut GfxCtx<'_>, opts: DrawOptions)
[src]
pub fn recalculate_current_selection(&mut self, ctx: &EventCtx<'_>)
[src]
Assumes some defaults.
pub fn mouseover_unzoomed_roads_and_intersections(
&self,
ctx: &EventCtx<'_>
) -> Option<ID>
[src]
&self,
ctx: &EventCtx<'_>
) -> Option<ID>
pub fn mouseover_unzoomed_buildings(&self, ctx: &EventCtx<'_>) -> Option<ID>
[src]
Only select buildings, and work whether zoomed in or not.
fn calculate_current_selection(
&self,
ctx: &EventCtx<'_>,
unzoomed_roads_and_intersections: bool,
unzoomed_buildings: bool
) -> Option<ID>
[src]
&self,
ctx: &EventCtx<'_>,
unzoomed_roads_and_intersections: bool,
unzoomed_buildings: bool
) -> Option<ID>
Trait Implementations
impl<T: 'static> AppLike for SimpleApp<T>
[src]
impl<T: 'static> AppLike for SimpleApp<T>
[src]fn map(&self) -> &Map
[src]
fn sim(&self) -> &Sim
[src]
fn cs(&self) -> &ColorScheme
[src]
fn mut_cs(&mut self) -> &mut ColorScheme
[src]
fn draw_map(&self) -> &DrawMap
[src]
fn mut_draw_map(&mut self) -> &mut DrawMap
[src]
fn opts(&self) -> &Options
[src]
fn mut_opts(&mut self) -> &mut Options
[src]
fn map_switched(
&mut self,
ctx: &mut EventCtx<'_>,
map: Map,
timer: &mut Timer<'_>
)
[src]
&mut self,
ctx: &mut EventCtx<'_>,
map: Map,
timer: &mut Timer<'_>
)
fn draw_with_opts(&self, g: &mut GfxCtx<'_>, opts: DrawOptions)
[src]
fn make_warper(
&mut self,
ctx: &EventCtx<'_>,
pt: Pt2D,
target_cam_zoom: Option<f64>,
_: Option<ID>
) -> Box<dyn State<SimpleApp<T>>>
[src]
&mut self,
ctx: &EventCtx<'_>,
pt: Pt2D,
target_cam_zoom: Option<f64>,
_: Option<ID>
) -> Box<dyn State<SimpleApp<T>>>
fn sim_time(&self) -> Time
[src]
fn current_stage_and_remaining_time(
&self,
id: IntersectionID
) -> (usize, Duration)
[src]
&self,
id: IntersectionID
) -> (usize, Duration)
fn change_color_scheme(
&mut self,
ctx: &mut EventCtx<'_>,
cs: ColorSchemeChoice
) -> bool
[src]
&mut self,
ctx: &mut EventCtx<'_>,
cs: ColorSchemeChoice
) -> bool
impl<T: 'static> SharedAppState for SimpleApp<T>
[src]
impl<T: 'static> SharedAppState for SimpleApp<T>
[src]fn draw_default(&self, g: &mut GfxCtx<'_>)
[src]
fn dump_before_abort(&self, canvas: &Canvas)
[src]
fn before_quit(&self, canvas: &Canvas)
[src]
fn free_memory(&mut self)
[src]
pub fn before_event(&mut self)
impl<T> State<SimpleApp<T>> for SimpleWarper
[src]
impl<T> State<SimpleApp<T>> for SimpleWarper
[src]fn event(
&mut self,
ctx: &mut EventCtx<'_>,
_: &mut SimpleApp<T>
) -> Transition<SimpleApp<T>>
[src]
&mut self,
ctx: &mut EventCtx<'_>,
_: &mut SimpleApp<T>
) -> Transition<SimpleApp<T>>
fn draw(&self, _: &mut GfxCtx<'_>, _: &SimpleApp<T>)
[src]
pub fn draw_baselayer(&self) -> DrawBaselayer
pub fn on_destroy(&mut self, &mut EventCtx<'_>, &mut A)
Auto Trait Implementations
impl<T> !RefUnwindSafe for SimpleApp<T>
impl<T> !Send for SimpleApp<T>
impl<T> !Sync for SimpleApp<T>
impl<T> Unpin for SimpleApp<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SimpleApp<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,