[][src]Struct game::app::App

pub struct App {
    pub primary: PerMap,
    pub cs: ColorScheme,
    pub opts: Options,
    pub per_obj: PerObjectActions,
    pub session: SessionState,
}

The top-level data that lasts through the entire game, no matter what state the game is in.

Fields

primary: PerMapcs: ColorSchemeopts: Optionsper_obj: PerObjectActionssession: SessionState

Static data that lasts the entire session. Use sparingly.

Implementations

impl App[src]

pub fn has_prebaked(&self) -> Option<(&MapName, &String)>[src]

pub fn prebaked(&self) -> &Analytics[src]

pub fn set_prebaked(&mut self, prebaked: Option<(MapName, String, Analytics)>)[src]

pub fn draw(
    &self,
    g: &mut GfxCtx<'_>,
    opts: DrawOptions,
    show_objs: &dyn ShowObject
)
[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_intersections(&self, ctx: &EventCtx<'_>) -> Option<ID>[src]

pub fn mouseover_unzoomed_buildings(&self, ctx: &EventCtx<'_>) -> Option<ID>[src]

pub fn mouseover_unzoomed_everything(&self, ctx: &EventCtx<'_>) -> Option<ID>[src]

pub fn mouseover_debug_mode(
    &self,
    ctx: &EventCtx<'_>,
    show_objs: &dyn ShowObject
) -> Option<ID>
[src]

fn calculate_current_selection(
    &self,
    ctx: &EventCtx<'_>,
    show_objs: &dyn ShowObject,
    debug_mode: bool,
    unzoomed_roads_and_intersections: bool,
    unzoomed_buildings: bool
) -> Option<ID>
[src]

fn get_renderables_back_to_front<'a>(
    &'a self,
    bounds: Bounds,
    prerender: &Prerender,
    agents: &'a mut AgentCache,
    show_objs: &dyn ShowObject
) -> Vec<&'a (dyn Renderable + 'a)>
[src]

pub fn clear_everything(&mut self, ctx: &mut EventCtx<'_>)[src]

Ensure the map edits are blank, reset the simulation, and blank out prebaked results.

impl App[src]

pub fn click_on_intersection<S: Into<String>>(
    &mut self,
    ctx: &mut EventCtx<'_>,
    label: S
) -> Option<IntersectionID>
[src]

If an intersection was clicked, return its ID.

pub fn click_on_lane<S: Into<String>>(
    &mut self,
    ctx: &mut EventCtx<'_>,
    label: S
) -> Option<LaneID>
[src]

If a lane was clicked, return its ID.

Trait Implementations

impl AppLike for App[src]

impl MinimapControls<App> for MinimapController[src]

impl SharedAppState for App[src]

impl SimpleState<App> for LaneEditor[src]

impl SimpleState<App> for StopSignEditor[src]

impl SimpleState<App> for MergeIntersections[src]

impl SimpleState<App> for ChangeDuration[src]

impl SimpleState<App> for ShowAbsolute[src]

impl SimpleState<App> for ShowRelative[src]

impl SimpleState<App> for TuneRelative[src]

impl SimpleState<App> for About[src]

impl SimpleState<App> for ChangeScenario[src]

impl SimpleState<App> for UberTurnPicker[src]

impl SimpleState<App> for UberTurnViewer[src]

impl State<App> for CutscenePlayer[src]

impl State<App> for FYI[src]

impl State<App> for AllRoutesExplorer[src]

impl State<App> for DebugMode[src]

impl State<App> for ScreenshotTest[src]

impl State<App> for CollisionsViewer[src]

impl State<App> for PopularDestinations[src]

impl State<App> for ViewKML[src]

impl State<App> for PolygonEditor[src]

impl State<App> for ScenarioManager[src]

impl State<App> for StoryMapEditor[src]

impl State<App> for DevToolsMode[src]

impl State<App> for ChallengesPicker[src]

impl State<App> for BulkSelect[src]

impl State<App> for BulkEdit[src]

impl State<App> for ClusterTrafficSignalEditor[src]

impl State<App> for RouteEditor[src]

impl State<App> for SignalPicker[src]

impl State<App> for PreviewTrafficSignal[src]

impl State<App> for TrafficSignalEditor[src]

impl State<App> for ZoneEditor[src]

impl State<App> for EditMode[src]

impl State<App> for SaveEdits[src]

impl State<App> for Warping[src]

impl State<App> for LoadEdits[src]

impl State<App> for ConfirmDiscard[src]

impl State<App> for PickLayer[src]

impl State<App> for TitleScreen[src]

impl State<App> for MainMenu[src]

impl State<App> for About[src]

impl State<App> for Proposals[src]

impl State<App> for CommuterPatterns[src]

impl<T: 'static, F: 'static, P: 'static + Fn(&mut EventCtx<'_>, &App, &Table<App, T, F>) -> Panel> State<App> for GenericTripTable<T, F, P>[src]

impl State<App> for ActiveTraffic[src]

impl State<App> for DebugWarp[src]

impl State<App> for TransitRoutes[src]

impl State<App> for TripSummaries[src]

impl State<App> for TrafficSignalDemand[src]

impl State<App> for AgentSpawner[src]

impl State<App> for EditScenarioModifiers[src]

impl State<App> for ChangeMode[src]

impl State<App> for FinalScore[src]

impl State<App> for TrafficRecorder[src]

impl State<App> for JumpToTime[src]

impl State<App> for JumpToDelay[src]

impl State<App> for Viewer[src]

impl State<App> for TimeWarpScreen[src]

impl State<App> for SandboxMode[src]

impl State<App> for BackToMainMenu[src]

impl State<App> for SandboxLoader[src]

impl State<App> for Floodfiller[src]

impl State<App> for PathCounter[src]

impl State<App> for PolygonDebugger[src]

impl State<App> for RouteExplorer[src]

Auto Trait Implementations

impl !RefUnwindSafe for App[src]

impl !Send for App[src]

impl !Sync for App[src]

impl Unpin for App[src]

impl !UnwindSafe for App[src]

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>,