This commit is contained in:
dabreegster 2021-03-12 14:49:11 +00:00
parent f0425d8222
commit a9c298e218
33 changed files with 87 additions and 64 deletions

View File

@ -1,5 +1,5 @@
<!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="API documentation for the Rust `add_study_area` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, add_study_area"><title>game::app::add_study_area - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../game/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">game</a>::<wbr><a href="index.html">app</a></p><script>window.sidebarCurrent = {name: "add_study_area", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/game/app.rs.html#875-907" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">game</a>::<wbr><a href="index.html">app</a>::<wbr><a class="fn" href="">add_study_area</a></span></h1><pre class="rust fn">fn add_study_area(map: &amp;mut <a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.38/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</pre><div class="docblock"><p>Load an extra GeoJSON file, and add the area to the map dynamically.</p>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/game/app.rs.html#879-911" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">game</a>::<wbr><a href="index.html">app</a>::<wbr><a class="fn" href="">add_study_area</a></span></h1><pre class="rust fn">fn add_study_area(map: &amp;mut <a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.38/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;</pre><div class="docblock"><p>Load an extra GeoJSON file, and add the area to the map dynamically.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "game";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,7 +1,7 @@
<!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="API documentation for the Rust `app` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, app"><title>game::app - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../game/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module app</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class="location"><a href="../index.html">game</a></p><script>window.sidebarCurrent = {name: "app", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/game/app.rs.html#1-907" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">game</a>::<wbr><a class="mod" href="">app</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/game/app.rs.html#1-911" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">game</a>::<wbr><a class="mod" href="">app</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.App.html" title="game::app::App struct">App</a></td><td class="docblock-short"><p>The top-level data that lasts through the entire game, no matter what state the game is in.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.FindDelayedIntersections.html" title="game::app::FindDelayedIntersections struct">FindDelayedIntersections</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Flags.html" title="game::app::Flags struct">Flags</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.PerMap.html" title="game::app::PerMap struct">PerMap</a></td><td class="docblock-short"><p>All of the state that's bound to a specific map.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.PerObjectActions.html" title="game::app::PerObjectActions struct">PerObjectActions</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.SessionState.html" title="game::app::SessionState struct">SessionState</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.ShowEverything.html" title="game::app::ShowEverything struct">ShowEverything</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.ShowLayers.html" title="game::app::ShowLayers struct">ShowLayers</a></td><td class="docblock-short"></td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>

View File

@ -27,10 +27,10 @@ minimap. <a href="../../map_gui/tools/minimap/trait.MinimapControls.html#method.
</div><h4 id="method.make_zoomed_side_panel" class="method hidden"><code>fn <a href="../../map_gui/tools/minimap/trait.MinimapControls.html#method.make_zoomed_side_panel" class="fnname">make_zoomed_side_panel</a>(&amp;self, ctx: &amp;mut EventCtx&lt;'_&gt;, app: &amp;<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -&gt; Widget</code><a class="srclink" href="../../src/game/sandbox/minimap.rs.html#55-57" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Controls to be placed to the left to the zoomed-in panel</p>
</div><h4 id="method.panel_clicked" class="method hidden"><code>fn <a href="../../map_gui/tools/minimap/trait.MinimapControls.html#method.panel_clicked" class="fnname">panel_clicked</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;app: &amp;mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;action: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Transition&lt;<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>&gt;&gt;</code><a class="srclink" href="../../src/game/sandbox/minimap.rs.html#59-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>If a button is clicked that was produced by some method in this trait, respond to it here.</p>
</div><h4 id="method.panel_changed" class="method hidden"><code>fn <a href="../../map_gui/tools/minimap/trait.MinimapControls.html#method.panel_changed" class="fnname">panel_changed</a>(&amp;self, _: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>, panel: &amp;Panel)</code><a class="srclink" href="../../src/game/sandbox/minimap.rs.html#88-96" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called for <code>Outcome::Changed</code> on the panel.</p>
</div></div><h3 id="impl-SharedAppState" class="impl"><code class="in-band">impl SharedAppState for <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a></code><a href="#impl-SharedAppState" class="anchor"></a><a class="srclink" href="../../src/game/app.rs.html#817-872" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.before_event" class="method hidden"><code>fn <a href="#method.before_event" class="fnname">before_event</a>(&amp;mut self)</code><a class="srclink" href="../../src/game/app.rs.html#818-820" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Before <code>State::event</code> is called, call this.</p>
</div><h4 id="method.draw_default" class="method hidden"><code>fn <a href="#method.draw_default" class="fnname">draw_default</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;)</code><a class="srclink" href="../../src/game/app.rs.html#822-824" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>When DrawBaselayer::DefaultDraw is called, run this.</p>
</div><h4 id="method.dump_before_abort" class="method hidden"><code>fn <a href="#method.dump_before_abort" class="fnname">dump_before_abort</a>(&amp;self, canvas: &amp;Canvas)</code><a class="srclink" href="../../src/game/app.rs.html#826-867" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Will be called if <code>State::event</code> or <code>State::draw</code> panics.</p>
</div><h4 id="method.before_quit" class="method hidden"><code>fn <a href="#method.before_quit" class="fnname">before_quit</a>(&amp;self, canvas: &amp;Canvas)</code><a class="srclink" href="../../src/game/app.rs.html#869-871" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called before a normal exit, like window close</p>
</div></div><h3 id="impl-SharedAppState" class="impl"><code class="in-band">impl SharedAppState for <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a></code><a href="#impl-SharedAppState" class="anchor"></a><a class="srclink" href="../../src/game/app.rs.html#821-876" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.before_event" class="method hidden"><code>fn <a href="#method.before_event" class="fnname">before_event</a>(&amp;mut self)</code><a class="srclink" href="../../src/game/app.rs.html#822-824" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Before <code>State::event</code> is called, call this.</p>
</div><h4 id="method.draw_default" class="method hidden"><code>fn <a href="#method.draw_default" class="fnname">draw_default</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;)</code><a class="srclink" href="../../src/game/app.rs.html#826-828" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>When DrawBaselayer::DefaultDraw is called, run this.</p>
</div><h4 id="method.dump_before_abort" class="method hidden"><code>fn <a href="#method.dump_before_abort" class="fnname">dump_before_abort</a>(&amp;self, canvas: &amp;Canvas)</code><a class="srclink" href="../../src/game/app.rs.html#830-871" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Will be called if <code>State::event</code> or <code>State::draw</code> panics.</p>
</div><h4 id="method.before_quit" class="method hidden"><code>fn <a href="#method.before_quit" class="fnname">before_quit</a>(&amp;self, canvas: &amp;Canvas)</code><a class="srclink" href="../../src/game/app.rs.html#873-875" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called before a normal exit, like window close</p>
</div></div><h3 id="impl-SimpleState%3CApp%3E" class="impl"><code class="in-band">impl SimpleState&lt;<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>&gt; for <a class="struct" href="../../game/debug/uber_turns/struct.UberTurnPicker.html" title="struct game::debug::uber_turns::UberTurnPicker">UberTurnPicker</a></code><a href="#impl-SimpleState%3CApp%3E" class="anchor"></a><a class="srclink" href="../../src/game/debug/uber_turns.rs.html#59-128" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.on_click" class="method hidden"><code>fn <a href="#method.on_click" class="fnname">on_click</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;app: &amp;mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;x: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;Panel<br>) -&gt; Transition&lt;<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>&gt;</code><a class="srclink" href="../../src/game/debug/uber_turns.rs.html#60-96" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called when something on the panel has been clicked. Since the action is just a string,
the fallback case can just use <code>unreachable!()</code>. <a href="#tymethod.on_click">Read more</a></p>
</div><h4 id="method.on_mouseover" class="method hidden"><code>fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&amp;mut self, ctx: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/debug/uber_turns.rs.html#98-100" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called when the mouse has moved.</p>

File diff suppressed because one or more lines are too long

View File

@ -29,10 +29,10 @@ scenario name too.</p>
gameplay mode; always verify the name matches what's needed.</p>
<p>Storing this may cost some memory, but otherwise resetting to midnight would require
loading it again from a file. This is particularly painful on the web!</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/game/app.rs.html#644-753" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.map_loaded" class="method"><code>pub fn <a href="#method.map_loaded" class="fnname">map_loaded</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;map: <a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sim: <a class="struct" href="../../sim/sim/struct.Sim.html" title="struct sim::sim::Sim">Sim</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;flags: <a class="struct" href="../../game/app/struct.Flags.html" title="struct game::app::Flags">Flags</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;opts: &amp;<a class="struct" href="../../map_gui/options/struct.Options.html" title="struct map_gui::options::Options">Options</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;cs: &amp;<a class="struct" href="../../map_gui/colors/struct.ColorScheme.html" title="struct map_gui::colors::ColorScheme">ColorScheme</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;timer: &amp;mut <a class="struct" href="../../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a>&lt;'_&gt;<br>) -&gt; <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a class="srclink" href="../../src/game/app.rs.html#645-681" title="goto source code">[src]</a></h4><h4 id="method.init_camera_for_loaded_map" class="method"><code>pub fn <a href="#method.init_camera_for_loaded_map" class="fnname">init_camera_for_loaded_map</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;splash: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>)</code><a class="srclink" href="../../src/game/app.rs.html#683-706" title="goto source code">[src]</a></h4><h4 id="method.clear_sim" class="method"><code>pub fn <a href="#method.clear_sim" class="fnname">clear_sim</a>(&amp;mut self) -&gt; <a class="struct" href="../../sim/sim/struct.Sim.html" title="struct sim::sim::Sim">Sim</a></code><a class="srclink" href="../../src/game/app.rs.html#709-715" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns whatever was there</p>
</div><h4 id="method.calculate_unedited_map" class="method"><code>pub fn <a href="#method.calculate_unedited_map" class="fnname">calculate_unedited_map</a>(&amp;self)</code><a class="srclink" href="../../src/game/app.rs.html#720-730" title="goto source code">[src]</a></h4><div class="docblock"><p>If needed, makes sure the unedited_map is populated. Callers can then do
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/game/app.rs.html#644-757" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.map_loaded" class="method"><code>pub fn <a href="#method.map_loaded" class="fnname">map_loaded</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;map: <a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sim: <a class="struct" href="../../sim/sim/struct.Sim.html" title="struct sim::sim::Sim">Sim</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;flags: <a class="struct" href="../../game/app/struct.Flags.html" title="struct game::app::Flags">Flags</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;opts: &amp;<a class="struct" href="../../map_gui/options/struct.Options.html" title="struct map_gui::options::Options">Options</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;cs: &amp;<a class="struct" href="../../map_gui/colors/struct.ColorScheme.html" title="struct map_gui::colors::ColorScheme">ColorScheme</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;timer: &amp;mut <a class="struct" href="../../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a>&lt;'_&gt;<br>) -&gt; <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a class="srclink" href="../../src/game/app.rs.html#645-681" title="goto source code">[src]</a></h4><h4 id="method.init_camera_for_loaded_map" class="method"><code>pub fn <a href="#method.init_camera_for_loaded_map" class="fnname">init_camera_for_loaded_map</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;splash: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>)</code><a class="srclink" href="../../src/game/app.rs.html#683-706" title="goto source code">[src]</a></h4><h4 id="method.clear_sim" class="method"><code>pub fn <a href="#method.clear_sim" class="fnname">clear_sim</a>(&amp;mut self) -&gt; <a class="struct" href="../../sim/sim/struct.Sim.html" title="struct sim::sim::Sim">Sim</a></code><a class="srclink" href="../../src/game/app.rs.html#709-715" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns whatever was there</p>
</div><h4 id="method.calculate_unedited_map" class="method"><code>pub fn <a href="#method.calculate_unedited_map" class="fnname">calculate_unedited_map</a>(&amp;self)</code><a class="srclink" href="../../src/game/app.rs.html#720-734" title="goto source code">[src]</a></h4><div class="docblock"><p>If needed, makes sure the unedited_map is populated. Callers can then do
<code>self.unedited_map.borrow().unwrap_or(&amp;self.map)</code>.</p>
</div><h4 id="method.canonical_point" class="method"><code>pub fn <a href="#method.canonical_point" class="fnname">canonical_point</a>(&amp;self, id: <a class="enum" href="../../map_gui/enum.ID.html" title="enum map_gui::ID">ID</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>&gt;</code><a class="srclink" href="../../src/game/app.rs.html#732-752" title="goto source code">[src]</a></h4></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div><h4 id="method.canonical_point" class="method"><code>pub fn <a href="#method.canonical_point" class="fnname">canonical_point</a>(&amp;self, id: <a class="enum" href="../../map_gui/enum.ID.html" title="enum map_gui::ID">ID</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>&gt;</code><a class="srclink" href="../../src/game/app.rs.html#736-756" title="goto source code">[src]</a></h4></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../game/app/struct.PerMap.html" title="struct game::app::PerMap">PerMap</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-Downcast" class="impl"><code class="in-band">impl&lt;T&gt; Downcast for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>,&nbsp;</span></code><a href="#impl-Downcast" class="anchor"></a></h3><div class="impl-items"><h4 id="method.into_any" class="method hidden"><code>pub fn <a href="#method.into_any" class="fnname">into_any</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;</code></h4><div class='docblock hidden'><p>Convert <code>Box&lt;dyn Trait&gt;</code> (where <code>Trait: Downcast</code>) to <code>Box&lt;dyn Any&gt;</code>. <code>Box&lt;dyn Any&gt;</code> can

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!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="API documentation for the Rust `prebake` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, prebake"><title>game::challenges::prebake::prebake - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a href="index.html">prebake</a></p><script>window.sidebarCurrent = {name: "prebake", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/challenges/prebake.rs.html#53-95" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a href="index.html">prebake</a>::<wbr><a class="fn" href="">prebake</a></span></h1><pre class="rust fn">fn prebake(<br>&nbsp;&nbsp;&nbsp;&nbsp;map: &amp;<a class="struct" href="../../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;scenario: <a class="struct" href="../../../sim/make/scenario/struct.Scenario.html" title="struct sim::make::scenario::Scenario">Scenario</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;opts: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../../sim/sim/struct.SimOptions.html" title="struct sim::sim::SimOptions">SimOptions</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;timer: &amp;mut <a class="struct" href="../../../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a>&lt;'_&gt;<br>)</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/challenges/prebake.rs.html#57-99" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a href="index.html">prebake</a>::<wbr><a class="fn" href="">prebake</a></span></h1><pre class="rust fn">fn prebake(<br>&nbsp;&nbsp;&nbsp;&nbsp;map: &amp;<a class="struct" href="../../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;scenario: <a class="struct" href="../../../sim/make/scenario/struct.Scenario.html" title="struct sim::make::scenario::Scenario">Scenario</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;opts: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../../sim/sim/struct.SimOptions.html" title="struct sim::sim::SimOptions">SimOptions</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;timer: &amp;mut <a class="struct" href="../../../abstutil/time/struct.Timer.html" title="struct abstutil::time::Timer">Timer</a>&lt;'_&gt;<br>)</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>

View File

@ -1,6 +1,6 @@
<!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="API documentation for the Rust `prebake_all` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, prebake_all"><title>game::challenges::prebake::prebake_all - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a href="index.html">prebake</a></p><script>window.sidebarCurrent = {name: "prebake_all", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/challenges/prebake.rs.html#11-51" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a href="index.html">prebake</a>::<wbr><a class="fn" href="">prebake_all</a></span></h1><pre class="rust fn">pub fn prebake_all()</pre><div class="docblock"><p>Simulate a curated list of scenarios to completion, and save the analytics as &quot;prebaked
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/challenges/prebake.rs.html#11-55" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a href="index.html">prebake</a>::<wbr><a class="fn" href="">prebake_all</a></span></h1><pre class="rust fn">pub fn prebake_all()</pre><div class="docblock"><p>Simulate a curated list of scenarios to completion, and save the analytics as &quot;prebaked
results,&quot; to later compare simulation metrics against the baseline without map edits.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>

View File

@ -1,7 +1,7 @@
<!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="API documentation for the Rust `prebake` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, prebake"><title>game::challenges::prebake - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module prebake</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a></p><script>window.sidebarCurrent = {name: "prebake", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/challenges/prebake.rs.html#1-95" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a class="mod" href="">prebake</a></span></h1><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/challenges/prebake.rs.html#1-99" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">challenges</a>::<wbr><a class="mod" href="">prebake</a></span></h1><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.prebake.html" title="game::challenges::prebake::prebake fn">prebake</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.prebake_all.html" title="game::challenges::prebake::prebake_all fn">prebake_all</a></td><td class="docblock-short"><p>Simulate a curated list of scenarios to completion, and save the analytics as &quot;prebaked
results,&quot; to later compare simulation metrics against the baseline without map edits.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>

View File

@ -1,5 +1,5 @@
<!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="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-a95c4551e63dceca/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Fri, 12 Mar 2021 03:54:15 +0000&quot;;</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-a95c4551e63dceca/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Fri, 12 Mar 2021 14:46:53 +0000&quot;;</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>

View File

@ -1,7 +1,7 @@
<!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="API documentation for the Rust `map` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, map"><title>map_model::map - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module map</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class="location"><a href="../index.html">map_model</a></p><script>window.sidebarCurrent = {name: "map", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/map_model/map.rs.html#1-724" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">map_model</a>::<wbr><a class="mod" href="">map</a></span></h1><div class="docblock"><p>A bunch of (mostly read-only) queries on a Map.</p>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/map_model/map.rs.html#1-725" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">map_model</a>::<wbr><a class="mod" href="">map</a></span></h1><div class="docblock"><p>A bunch of (mostly read-only) queries on a Map.</p>
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.MapConfig.html" title="map_model::map::MapConfig struct">MapConfig</a></td><td class="docblock-short"></td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.DrivingSide.html" title="map_model::map::DrivingSide enum">DrivingSide</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "map_model";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<!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="API documentation for the Rust `load` mod in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, load"><title>sim::make::load - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../../sim/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module load</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../../index.html">sim</a>::<wbr><a href="../index.html">make</a></p><script>window.sidebarCurrent = {name: "load", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/sim/make/load.rs.html#1-117" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">sim</a>::<wbr><a href="../index.html">make</a>::<wbr><a class="mod" href="">load</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/sim/make/load.rs.html#1-118" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">sim</a>::<wbr><a href="../index.html">make</a>::<wbr><a class="mod" href="">load</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.SimFlags.html" title="sim::make::load::SimFlags struct">SimFlags</a></td><td class="docblock-short"><p>SimFlags specifies a simulation to setup.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "sim";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -196,7 +196,7 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">&quot;augment scenario&quot;</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">scenario</span>: <span class="ident">Scenario</span> <span class="op">=</span> <span class="ident">abstio</span>::<span class="ident">must_read_object</span>(<span class="ident">input</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">scenario</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">scenario</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">if</span> <span class="ident">should_add_return_trips</span> {
<span class="ident">add_return_trips</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">scenario</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">rng</span>);

View File

@ -16,7 +16,7 @@
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">args</span> <span class="op">=</span> <span class="ident">CmdArgs</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">args</span>.<span class="ident">required_free</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Timer</span>::<span class="ident">throwaway</span>());
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">args</span>.<span class="ident">required_free</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Timer</span>::<span class="ident">throwaway</span>());
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">abstutil</span>::<span class="ident">to_json</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>));
<span class="ident">args</span>.<span class="ident">done</span>();
}

View File

@ -908,6 +908,10 @@
<span id="905">905</span>
<span id="906">906</span>
<span id="907">907</span>
<span id="908">908</span>
<span id="909">909</span>
<span id="910">910</span>
<span id="911">911</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cell</span>::<span class="ident">RefCell</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
@ -1636,7 +1640,11 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">orig_map</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">unedited_map</span>.<span class="ident">borrow_mut</span>();
<span class="kw">if</span> <span class="ident">orig_map</span>.<span class="ident">is_none</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">&quot;load unedited map&quot;</span>);
<span class="kw-2">*</span><span class="ident">orig_map</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Map</span>::<span class="ident">new</span>(<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get_name</span>().<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>));
<span class="comment">// TODO Need to fix this</span>
<span class="kw-2">*</span><span class="ident">orig_map</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Map</span>::<span class="ident">load_synchronously</span>(
<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get_name</span>().<span class="ident">path</span>(),
<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>,
));
}
}

View File

@ -96,6 +96,10 @@
<span id="93">93</span>
<span id="94">94</span>
<span id="95">95</span>
<span id="96">96</span>
<span id="97">97</span>
<span id="98">98</span>
<span id="99">99</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">abstio</span>::<span class="ident">MapName</span>;
<span class="kw">use</span> <span class="ident">abstutil</span>::{<span class="ident">prettyprint_usize</span>, <span class="ident">Timer</span>};
@ -111,7 +115,8 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">&quot;prebake all challenge results&quot;</span>);
{
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">MapName</span>::<span class="ident">seattle</span>(<span class="string">&quot;montlake&quot;</span>).<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span>
<span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">MapName</span>::<span class="ident">seattle</span>(<span class="string">&quot;montlake&quot;</span>).<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">for</span> <span class="ident">generator</span> <span class="kw">in</span> <span class="ident">TutorialState</span>::<span class="ident">scenarios_to_prebake</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>) {
<span class="kw">let</span> <span class="ident">scenario</span> <span class="op">=</span> <span class="ident">generator</span>.<span class="ident">generate</span>(
<span class="kw-2">&amp;</span><span class="ident">map</span>,
@ -130,14 +135,17 @@
<span class="ident">MapName</span>::<span class="ident">seattle</span>(<span class="string">&quot;rainier_valley&quot;</span>),
<span class="comment">//MapName::seattle(&quot;wallingford&quot;), TODO broken</span>
] {
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">scenario</span>: <span class="ident">Scenario</span> <span class="op">=</span>
<span class="ident">abstio</span>::<span class="ident">read_binary</span>(<span class="ident">abstio</span>::<span class="ident">path_scenario</span>(<span class="ident">map</span>.<span class="ident">get_name</span>(), <span class="string">&quot;weekday&quot;</span>), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="ident">prebake</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>, <span class="ident">scenario</span>, <span class="prelude-val">None</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
}
<span class="kw">for</span> <span class="ident">scenario_name</span> <span class="kw">in</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&quot;base&quot;</span>, <span class="string">&quot;go_active&quot;</span>, <span class="string">&quot;base_with_bg&quot;</span>, <span class="string">&quot;go_active_with_bg&quot;</span>] {
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">MapName</span>::<span class="ident">new</span>(<span class="string">&quot;gb&quot;</span>, <span class="string">&quot;poundbury&quot;</span>, <span class="string">&quot;center&quot;</span>).<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">load_synchronously</span>(
<span class="ident">MapName</span>::<span class="ident">new</span>(<span class="string">&quot;gb&quot;</span>, <span class="string">&quot;poundbury&quot;</span>, <span class="string">&quot;center&quot;</span>).<span class="ident">path</span>(),
<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>,
);
<span class="kw">let</span> <span class="ident">scenario</span>: <span class="ident">Scenario</span> <span class="op">=</span> <span class="ident">abstio</span>::<span class="ident">read_binary</span>(
<span class="ident">abstio</span>::<span class="ident">path_scenario</span>(<span class="ident">map</span>.<span class="ident">get_name</span>(), <span class="ident">scenario_name</span>),
<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>,

View File

@ -122,7 +122,7 @@
<span class="doccomment">/// The output of `rustdoc -V`</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;rustdoc 1.50.0 (cb75ad5db 2021-02-10)&quot;</span>;
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Fri, 12 Mar 2021 03:54:15 +0000&quot;</span>;
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Fri, 12 Mar 2021 14:46:53 +0000&quot;</span>;
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;x86_64&quot;</span>;
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>

View File

@ -541,7 +541,7 @@
<span class="comment">// work on the web.</span>
<span class="kw">let</span> <span class="ident">primary</span> <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">loading_screen</span>(<span class="string">&quot;load map&quot;</span>, <span class="op">|</span><span class="ident">ctx</span>, <span class="kw-2">mut</span> <span class="ident">timer</span><span class="op">|</span> {
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">flags</span>.<span class="ident">sim_flags</span>.<span class="ident">modifiers</span>.<span class="ident">is_empty</span>());
<span class="kw">let</span> (<span class="ident">map</span>, <span class="ident">sim</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">flags</span>.<span class="ident">sim_flags</span>.<span class="ident">load</span>(<span class="ident">timer</span>);
<span class="kw">let</span> (<span class="ident">map</span>, <span class="ident">sim</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">flags</span>.<span class="ident">sim_flags</span>.<span class="ident">load_synchronously</span>(<span class="ident">timer</span>);
<span class="kw">crate</span>::<span class="ident">app</span>::<span class="ident">PerMap</span>::<span class="ident">map_loaded</span>(<span class="ident">map</span>, <span class="ident">sim</span>, <span class="ident">flags</span>, <span class="kw-2">&amp;</span><span class="ident">opts</span>, <span class="kw-2">&amp;</span><span class="ident">cs</span>, <span class="ident">ctx</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>)
});
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App</span> {

View File

@ -185,7 +185,7 @@
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">&quot;generate houses&quot;</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">args</span> <span class="op">=</span> <span class="ident">CmdArgs</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--map&quot;</span>), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--map&quot;</span>), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">num_required</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--num_required&quot;</span>).<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span>().<span class="ident">unwrap</span>();
<span class="kw">let</span> <span class="ident">out</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--out&quot;</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">XorShiftRng</span>::<span class="ident">seed_from_u64</span>(<span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--rng_seed&quot;</span>).<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">u64</span><span class="op">&gt;</span>().<span class="ident">unwrap</span>());

View File

@ -1083,7 +1083,7 @@
<span class="kw">fn</span> <span class="ident">setup</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">timer</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Timer</span>) <span class="op">-</span><span class="op">&gt;</span> (<span class="ident">Map</span>, <span class="ident">Sim</span>) {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">scenario</span>: <span class="ident">Scenario</span> <span class="op">=</span> <span class="ident">abstio</span>::<span class="ident">must_read_object</span>(<span class="self">self</span>.<span class="ident">scenario</span>.<span class="ident">clone</span>(), <span class="ident">timer</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">scenario</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">scenario</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">perma</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">edits</span>.<span class="ident">clone</span>() {
<span class="kw">let</span> <span class="ident">edits</span> <span class="op">=</span> <span class="ident">perma</span>.<span class="ident">to_edits</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>).<span class="ident">unwrap</span>();
<span class="ident">map</span>.<span class="ident">must_apply_edits</span>(<span class="ident">edits</span>);

View File

@ -53,7 +53,7 @@
<span class="ident">args</span>.<span class="ident">done</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">&quot;import traffic demand data&quot;</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">map</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">map</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">input</span>: <span class="ident">Input</span> <span class="op">=</span> <span class="ident">abstio</span>::<span class="ident">read_json</span>(<span class="ident">input</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">s</span> <span class="op">=</span> <span class="ident">Scenario</span>::<span class="ident">empty</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>, <span class="kw-2">&amp;</span><span class="ident">input</span>.<span class="ident">scenario_name</span>);

View File

@ -594,7 +594,7 @@
<span class="prelude-val">Some</span>(<span class="ident">map</span>)
} <span class="kw">else</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">scenario</span> {
<span class="prelude-val">Some</span>(<span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>))
<span class="prelude-val">Some</span>(<span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>))
} <span class="kw">else</span> {
<span class="prelude-val">None</span>
};

View File

@ -206,7 +206,7 @@
<span class="string">&quot;system/{}/{}/maps&quot;</span>,
<span class="ident">city_name</span>.<span class="ident">country</span>, <span class="ident">city_name</span>.<span class="ident">city</span>
))) {
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">path</span>, <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">path</span>, <span class="ident">timer</span>);
<span class="kw">for</span> <span class="ident">area</span> <span class="kw">in</span> <span class="ident">map</span>.<span class="ident">all_areas</span>() {
<span class="kw">let</span> <span class="ident">pts</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">gps_bounds</span>.<span class="ident">convert_back</span>(<span class="ident">area</span>.<span class="ident">polygon</span>.<span class="ident">points</span>());
<span class="comment">// TODO Holes in the polygons get lost</span>

View File

@ -725,6 +725,7 @@
<span id="722">722</span>
<span id="723">723</span>
<span id="724">724</span>
<span id="725">725</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="doccomment">//! A bunch of (mostly read-only) queries on a Map.</span>
@ -771,7 +772,9 @@
}
<span class="kw">impl</span> <span class="ident">Map</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">path</span>: <span class="ident">String</span>, <span class="ident">timer</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Timer</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Map</span> {
<span class="doccomment">/// Load a map from a local serialized Map or RawMap. Note this won&#39;t work on web. This should</span>
<span class="doccomment">/// only be used by non-UI tools.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">load_synchronously</span>(<span class="ident">path</span>: <span class="ident">String</span>, <span class="ident">timer</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Timer</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Map</span> {
<span class="kw">if</span> <span class="ident">path</span>.<span class="ident">contains</span>(<span class="string">&quot;/maps/&quot;</span>) {
<span class="kw">match</span> <span class="ident">abstio</span>::<span class="ident">maybe_read_binary</span>(<span class="ident">path</span>.<span class="ident">clone</span>(), <span class="ident">timer</span>) {
<span class="prelude-val">Ok</span>(<span class="ident">map</span>) <span class="op">=</span><span class="op">&gt;</span> {
@ -808,8 +811,7 @@
<span class="ident">Map</span>::<span class="ident">create_from_raw</span>(<span class="ident">raw</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="ident">timer</span>)
}
<span class="doccomment">/// If you have to deserialize a `Map` directly, call this after. Prefer using `Map::new`</span>
<span class="doccomment">/// though.</span>
<span class="doccomment">/// After deserializing a map directly, call this after.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">map_loaded_directly</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>) {
<span class="self">self</span>.<span class="ident">edits</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">new_edits</span>();

View File

@ -33,7 +33,7 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">args</span> <span class="op">=</span> <span class="ident">CmdArgs</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">seed</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--rng&quot;</span>).<span class="ident">parse</span>().<span class="ident">unwrap</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">XorShiftRng</span>::<span class="ident">seed_from_u64</span>(<span class="ident">seed</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--map&quot;</span>), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Timer</span>::<span class="ident">throwaway</span>());
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--map&quot;</span>), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Timer</span>::<span class="ident">throwaway</span>());
<span class="kw">let</span> <span class="ident">scenario_name</span> <span class="op">=</span> <span class="ident">args</span>.<span class="ident">required</span>(<span class="string">&quot;--scenario_name&quot;</span>);
<span class="ident">args</span>.<span class="ident">done</span>();

View File

@ -118,6 +118,7 @@
<span id="115">115</span>
<span id="116">116</span>
<span id="117">117</span>
<span id="118">118</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">SeedableRng</span>;
<span class="kw">use</span> <span class="ident">rand_xorshift</span>::<span class="ident">XorShiftRng</span>;
@ -177,7 +178,8 @@
<span class="ident">XorShiftRng</span>::<span class="ident">seed_from_u64</span>(<span class="self">self</span>.<span class="ident">rng_seed</span>)
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">load</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">timer</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">abstutil</span>::<span class="ident">Timer</span>) <span class="op">-</span><span class="op">&gt;</span> (<span class="ident">Map</span>, <span class="ident">Sim</span>, <span class="ident">XorShiftRng</span>) {
<span class="doccomment">/// Loads a map and simulation. Not appropriate for use in the UI or on web.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">load_synchronously</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">timer</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">abstutil</span>::<span class="ident">Timer</span>) <span class="op">-</span><span class="op">&gt;</span> (<span class="ident">Map</span>, <span class="ident">Sim</span>, <span class="ident">XorShiftRng</span>) {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">make_rng</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">opts</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">opts</span>.<span class="ident">clone</span>();
@ -187,7 +189,7 @@
<span class="kw">let</span> <span class="ident">sim</span>: <span class="ident">Sim</span> <span class="op">=</span> <span class="ident">abstio</span>::<span class="ident">must_read_object</span>(<span class="self">self</span>.<span class="ident">load</span>.<span class="ident">clone</span>(), <span class="ident">timer</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">sim</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">sim</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>);
<span class="kw">match</span> <span class="ident">MapEdits</span>::<span class="ident">load</span>(
<span class="kw-2">&amp;</span><span class="ident">map</span>,
<span class="ident">abstio</span>::<span class="ident">path_edits</span>(<span class="ident">map</span>.<span class="ident">get_name</span>(), <span class="kw-2">&amp;</span><span class="ident">sim</span>.<span class="ident">edits_name</span>),
@ -208,7 +210,7 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">scenario</span>: <span class="ident">Scenario</span> <span class="op">=</span> <span class="ident">abstio</span>::<span class="ident">must_read_object</span>(<span class="self">self</span>.<span class="ident">load</span>.<span class="ident">clone</span>(), <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">scenario</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">scenario</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="ident">timer</span>);
<span class="kw">for</span> <span class="ident">m</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">modifiers</span> {
<span class="ident">scenario</span> <span class="op">=</span> <span class="ident">m</span>.<span class="ident">apply</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>, <span class="ident">scenario</span>);
@ -224,7 +226,7 @@
} <span class="kw">else</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">load</span>.<span class="ident">contains</span>(<span class="string">&quot;/raw_maps/&quot;</span>) <span class="op">|</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">load</span>.<span class="ident">contains</span>(<span class="string">&quot;/maps/&quot;</span>) {
<span class="macro">info</span><span class="macro">!</span>(<span class="string">&quot;Loading map {}&quot;</span>, <span class="self">self</span>.<span class="ident">load</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">new</span>(<span class="self">self</span>.<span class="ident">load</span>.<span class="ident">clone</span>(), <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="self">self</span>.<span class="ident">load</span>.<span class="ident">clone</span>(), <span class="ident">timer</span>);
<span class="ident">timer</span>.<span class="ident">start</span>(<span class="string">&quot;create sim&quot;</span>);
<span class="kw">let</span> <span class="ident">sim</span> <span class="op">=</span> <span class="ident">Sim</span>::<span class="ident">new</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>, <span class="ident">opts</span>);

View File

@ -326,7 +326,7 @@
<span class="kw">fn</span> <span class="ident">smoke_test</span>() <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">new</span>(<span class="string">&quot;run a smoke-test for all maps&quot;</span>);
<span class="kw">for</span> <span class="ident">name</span> <span class="kw">in</span> <span class="ident">MapName</span>::<span class="ident">list_all_maps</span>() {
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">scenario</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">map</span>.<span class="ident">get_city_name</span>() <span class="op">=</span><span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">CityName</span>::<span class="ident">seattle</span>() {
<span class="ident">abstio</span>::<span class="ident">read_binary</span>(<span class="ident">abstio</span>::<span class="ident">path_scenario</span>(<span class="kw-2">&amp;</span><span class="ident">name</span>, <span class="string">&quot;weekday&quot;</span>), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>)
} <span class="kw">else</span> {
@ -386,7 +386,7 @@
<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>,
) {
<span class="prelude-val">Ok</span>(<span class="ident">perma</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">new</span>(<span class="ident">perma</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">map_model</span>::<span class="ident">Map</span>::<span class="ident">load_synchronously</span>(<span class="ident">perma</span>.<span class="ident">map_name</span>.<span class="ident">path</span>(), <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Err</span>(<span class="ident">err</span>) <span class="op">=</span> <span class="ident">perma</span>.<span class="ident">clone</span>().<span class="ident">to_edits</span>(<span class="kw-2">&amp;</span><span class="ident">map</span>) {
<span class="ident">abstio</span>::<span class="ident">write_json</span>(
<span class="string">&quot;repair_attempt.json&quot;</span>.<span class="ident">to_string</span>(),

View File

@ -159,7 +159,7 @@
<span class="ident">args</span>.<span class="ident">done</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">timer</span> <span class="op">=</span> <span class="ident">Timer</span>::<span class="ident">throwaway</span>();
<span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">map</span>, <span class="kw-2">mut</span> <span class="ident">sim</span>, <span class="kw-2">mut</span> <span class="ident">rng</span>) <span class="op">=</span> <span class="ident">sim_flags</span>.<span class="ident">load</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="kw">let</span> (<span class="kw-2">mut</span> <span class="ident">map</span>, <span class="kw-2">mut</span> <span class="ident">sim</span>, <span class="kw-2">mut</span> <span class="ident">rng</span>) <span class="op">=</span> <span class="ident">sim_flags</span>.<span class="ident">load_synchronously</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">timer</span>);
<span class="comment">// Set the edits name up-front, so that the savestates get named reasonably too.</span>
{