[][src]Struct map_gui::simple_app::SimpleApp

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: Mapdraw_map: DrawMapcs: ColorSchemeopts: Optionscurrent_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]

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]

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]

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]

Trait Implementations

impl<T: 'static> AppLike for SimpleApp<T>[src]

impl<T: 'static> SharedAppState for SimpleApp<T>[src]

impl<T> State<SimpleApp<T>> for SimpleWarper[src]

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

impl<T> UnwindSafe for SimpleApp<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,