mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-22 14:52:07 +03:00
61 lines
15 KiB
HTML
61 lines
15 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An application wishing to use the tools in this crate has to implement this on the struct that implements `widgetry::SharedAppState`, so that the tools here can access the map. See `SimpleApp` for an example implementation."><title>AppLike in map_gui - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-081576b923113409.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="map_gui" data-themes="" data-resource-suffix="" data-rustdoc-version="1.79.0 (129f3b996 2024-06-10)" data-channel="1.79.0" data-search-js="search-bf21c90c8c1d92b1.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-e32f0c247825364d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-09095024cf37855e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../map_gui/index.html">map_gui</a><span class="version">0.1.0</span></h2></div><h2 class="location"><a href="#">AppLike</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.cs">cs</a></li><li><a href="#tymethod.current_stage_and_remaining_time">current_stage_and_remaining_time</a></li><li><a href="#tymethod.draw_map">draw_map</a></li><li><a href="#tymethod.draw_with_opts">draw_with_opts</a></li><li><a href="#tymethod.make_warper">make_warper</a></li><li><a href="#tymethod.map">map</a></li><li><a href="#tymethod.map_switched">map_switched</a></li><li><a href="#tymethod.mut_cs">mut_cs</a></li><li><a href="#tymethod.mut_draw_map">mut_draw_map</a></li><li><a href="#tymethod.mut_opts">mut_opts</a></li><li><a href="#tymethod.opts">opts</a></li><li><a href="#tymethod.sim_time">sim_time</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.change_color_scheme">change_color_scheme</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In crate map_gui</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../map_gui/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings">Settings</a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="index.html">map_gui</a>::<wbr><a class="trait" href="#">AppLike</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/map_gui/lib.rs.html#35-75">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait AppLike {
|
||
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 13 methods</span></summary> // Required methods
|
||
fn <a href="#tymethod.map" class="fn">map</a>(&self) -> &Map;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.cs" class="fn">cs</a>(&self) -> &<a class="struct" href="colors/struct.ColorScheme.html" title="struct map_gui::colors::ColorScheme">ColorScheme</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.mut_cs" class="fn">mut_cs</a>(&mut self) -> &mut <a class="struct" href="colors/struct.ColorScheme.html" title="struct map_gui::colors::ColorScheme">ColorScheme</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.draw_map" class="fn">draw_map</a>(&self) -> &<a class="struct" href="render/map/struct.DrawMap.html" title="struct map_gui::render::map::DrawMap">DrawMap</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.mut_draw_map" class="fn">mut_draw_map</a>(&mut self) -> &mut <a class="struct" href="render/map/struct.DrawMap.html" title="struct map_gui::render::map::DrawMap">DrawMap</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.opts" class="fn">opts</a>(&self) -> &<a class="struct" href="options/struct.Options.html" title="struct map_gui::options::Options">Options</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.mut_opts" class="fn">mut_opts</a>(&mut self) -> &mut <a class="struct" href="options/struct.Options.html" title="struct map_gui::options::Options">Options</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.map_switched" class="fn">map_switched</a>(
|
||
&mut self,
|
||
ctx: &mut EventCtx<'_>,
|
||
map: Map,
|
||
timer: &mut <a class="struct" href="../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a><'_>
|
||
);
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.draw_with_opts" class="fn">draw_with_opts</a>(&self, g: &mut GfxCtx<'_>, opts: <a class="struct" href="render/struct.DrawOptions.html" title="struct map_gui::render::DrawOptions">DrawOptions</a>);
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.make_warper" class="fn">make_warper</a>(
|
||
&mut self,
|
||
ctx: &EventCtx<'_>,
|
||
pt: Pt2D,
|
||
target_cam_zoom: <a class="enum" href="https://doc.rust-lang.org/1.79.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.79.0/std/primitive.f64.html">f64</a>>,
|
||
id: <a class="enum" href="https://doc.rust-lang.org/1.79.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="enum.ID.html" title="enum map_gui::ID">ID</a>>
|
||
) -> <a class="struct" href="https://doc.rust-lang.org/1.79.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<Self>>
|
||
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.79.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.sim_time" class="fn">sim_time</a>(&self) -> Time;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.current_stage_and_remaining_time" class="fn">current_stage_and_remaining_time</a>(
|
||
&self,
|
||
id: IntersectionID
|
||
) -> (<a class="primitive" href="https://doc.rust-lang.org/1.79.0/std/primitive.usize.html">usize</a>, Duration);
|
||
|
||
// Provided method
|
||
fn <a href="#method.change_color_scheme" class="fn">change_color_scheme</a>(
|
||
&mut self,
|
||
ctx: &mut EventCtx<'_>,
|
||
cs: <a class="enum" href="colors/enum.ColorSchemeChoice.html" title="enum map_gui::colors::ColorSchemeChoice">ColorSchemeChoice</a>
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/1.79.0/std/primitive.bool.html">bool</a> { ... }
|
||
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An application wishing to use the tools in this crate has to implement this on the struct that
|
||
implements <code>widgetry::SharedAppState</code>, so that the tools here can access the map. See
|
||
<code>SimpleApp</code> for an example implementation.</p>
|
||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.map" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#36">source</a><h4 class="code-header">fn <a href="#tymethod.map" class="fn">map</a>(&self) -> &Map</h4></section><section id="tymethod.cs" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#37">source</a><h4 class="code-header">fn <a href="#tymethod.cs" class="fn">cs</a>(&self) -> &<a class="struct" href="colors/struct.ColorScheme.html" title="struct map_gui::colors::ColorScheme">ColorScheme</a></h4></section><section id="tymethod.mut_cs" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#38">source</a><h4 class="code-header">fn <a href="#tymethod.mut_cs" class="fn">mut_cs</a>(&mut self) -> &mut <a class="struct" href="colors/struct.ColorScheme.html" title="struct map_gui::colors::ColorScheme">ColorScheme</a></h4></section><section id="tymethod.draw_map" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#39">source</a><h4 class="code-header">fn <a href="#tymethod.draw_map" class="fn">draw_map</a>(&self) -> &<a class="struct" href="render/map/struct.DrawMap.html" title="struct map_gui::render::map::DrawMap">DrawMap</a></h4></section><section id="tymethod.mut_draw_map" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#40">source</a><h4 class="code-header">fn <a href="#tymethod.mut_draw_map" class="fn">mut_draw_map</a>(&mut self) -> &mut <a class="struct" href="render/map/struct.DrawMap.html" title="struct map_gui::render::map::DrawMap">DrawMap</a></h4></section><section id="tymethod.opts" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#41">source</a><h4 class="code-header">fn <a href="#tymethod.opts" class="fn">opts</a>(&self) -> &<a class="struct" href="options/struct.Options.html" title="struct map_gui::options::Options">Options</a></h4></section><section id="tymethod.mut_opts" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#42">source</a><h4 class="code-header">fn <a href="#tymethod.mut_opts" class="fn">mut_opts</a>(&mut self) -> &mut <a class="struct" href="options/struct.Options.html" title="struct map_gui::options::Options">Options</a></h4></section><section id="tymethod.map_switched" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#43">source</a><h4 class="code-header">fn <a href="#tymethod.map_switched" class="fn">map_switched</a>(
|
||
&mut self,
|
||
ctx: &mut EventCtx<'_>,
|
||
map: Map,
|
||
timer: &mut <a class="struct" href="../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a><'_>
|
||
)</h4></section><section id="tymethod.draw_with_opts" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#44">source</a><h4 class="code-header">fn <a href="#tymethod.draw_with_opts" class="fn">draw_with_opts</a>(&self, g: &mut GfxCtx<'_>, opts: <a class="struct" href="render/struct.DrawOptions.html" title="struct map_gui::render::DrawOptions">DrawOptions</a>)</h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.make_warper" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#46-54">source</a><h4 class="code-header">fn <a href="#tymethod.make_warper" class="fn">make_warper</a>(
|
||
&mut self,
|
||
ctx: &EventCtx<'_>,
|
||
pt: Pt2D,
|
||
target_cam_zoom: <a class="enum" href="https://doc.rust-lang.org/1.79.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.79.0/std/primitive.f64.html">f64</a>>,
|
||
id: <a class="enum" href="https://doc.rust-lang.org/1.79.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="enum.ID.html" title="enum map_gui::ID">ID</a>>
|
||
) -> <a class="struct" href="https://doc.rust-lang.org/1.79.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<Self>><div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.79.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Create a <code>widgetry::State</code> that warps to the given point.</p>
|
||
</div></details><section id="tymethod.sim_time" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#58">source</a><h4 class="code-header">fn <a href="#tymethod.sim_time" class="fn">sim_time</a>(&self) -> Time</h4></section><section id="tymethod.current_stage_and_remaining_time" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#59">source</a><h4 class="code-header">fn <a href="#tymethod.current_stage_and_remaining_time" class="fn">current_stage_and_remaining_time</a>(
|
||
&self,
|
||
id: IntersectionID
|
||
) -> (<a class="primitive" href="https://doc.rust-lang.org/1.79.0/std/primitive.usize.html">usize</a>, Duration)</h4></section></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.change_color_scheme" class="method"><a class="src rightside" href="../src/map_gui/lib.rs.html#62-74">source</a><h4 class="code-header">fn <a href="#method.change_color_scheme" class="fn">change_color_scheme</a>(
|
||
&mut self,
|
||
ctx: &mut EventCtx<'_>,
|
||
cs: <a class="enum" href="colors/enum.ColorSchemeChoice.html" title="enum map_gui::colors::ColorSchemeChoice">ColorSchemeChoice</a>
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/1.79.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Change the color scheme. Idempotent. Return true if there was a change.</p>
|
||
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AppLike-for-SimpleApp%3CT%3E" class="impl"><a class="src rightside" href="../src/map_gui/simple_app.rs.html#274-354">source</a><a href="#impl-AppLike-for-SimpleApp%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T: 'static> <a class="trait" href="trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> for <a class="struct" href="simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><T></h3></section></div><script src="../trait.impl/map_gui/trait.AppLike.js" async></script></section></div></main></body></html> |