This commit is contained in:
dabreegster 2021-10-28 22:25:56 +00:00
parent 2e79386928
commit 57bfe9049b
21 changed files with 185 additions and 61 deletions

File diff suppressed because one or more lines are too long

View File

@ -45,11 +45,11 @@ the event and immediately apply the transition. <a href="#method.panel_changed">
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.other_event" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;</h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didnt occur and <code>panel_changed</code> didnt return transition, then </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.other_event" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A) -&gt; Transition&lt;A&gt;</h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didnt occur and <code>panel_changed</code> didnt return transition, then
call this to handle all other events. <a href="#method.other_event">Read more</a></p> call this to handle all other events. <a href="#method.other_event">Read more</a></p>
</div></details><div id="method.draw_baselayer-66" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-66" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&amp;self) -&gt; DrawBaselayer</h4></div></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-SimpleState%3CApp%3E-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#181-225" title="goto source code">[src]</a></div><a href="#impl-SimpleState%3CApp%3E-1" class="anchor"></a><h3 class="code-header in-band">impl SimpleState&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt; for <a class="struct" href="../debug/blockfinder/struct.OneBlock.html" title="struct game::debug::blockfinder::OneBlock">OneBlock</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#182-215" title="goto source code">[src]</a></div><a href="#method.on_click-1" class="anchor"></a><h4 class="code-header">fn <a 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="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/1.56.0/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;Panel<br>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked. Since the action is just a string, </div></details><div id="method.draw_baselayer-66" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-66" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&amp;self) -&gt; DrawBaselayer</h4></div></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-SimpleState%3CApp%3E-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#198-242" title="goto source code">[src]</a></div><a href="#impl-SimpleState%3CApp%3E-1" class="anchor"></a><h3 class="code-header in-band">impl SimpleState&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt; for <a class="struct" href="../debug/blockfinder/struct.OneBlock.html" title="struct game::debug::blockfinder::OneBlock">OneBlock</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#199-232" title="goto source code">[src]</a></div><a href="#method.on_click-1" class="anchor"></a><h4 class="code-header">fn <a 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="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/1.56.0/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;Panel<br>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><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> the fallback case can just use <code>unreachable!()</code>. <a href="#tymethod.on_click">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#217-220" title="goto source code">[src]</a></div><a href="#method.other_event-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</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;_: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a><br>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didnt occur and <code>panel_changed</code> didnt return transition, then </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#234-237" title="goto source code">[src]</a></div><a href="#method.other_event-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</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;_: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a><br>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didnt occur and <code>panel_changed</code> didnt return transition, then
call this to handle all other events. <a href="#method.other_event">Read more</a></p> call this to handle all other events. <a href="#method.other_event">Read more</a></p>
</div></details><div id="method.draw-68" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#222-224" title="goto source code">[src]</a></div><a href="#method.draw-68" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;, _: &amp;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click_custom-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_click_custom-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_click_custom" class="fnname">on_click_custom</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: <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A, <br>&nbsp;&nbsp;&nbsp;&nbsp;_action: <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../../abstutil/clone/trait.CloneableAny.html" title="trait abstutil::clone::CloneableAny">CloneableAny</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;_panel: &amp;Panel<br>) -&gt; Transition&lt;A&gt;</h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked.</p> </div></details><div id="method.draw-68" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#239-241" title="goto source code">[src]</a></div><a href="#method.draw-68" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;, _: &amp;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click_custom-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_click_custom-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_click_custom" class="fnname">on_click_custom</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: <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A, <br>&nbsp;&nbsp;&nbsp;&nbsp;_action: <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../../abstutil/clone/trait.CloneableAny.html" title="trait abstutil::clone::CloneableAny">CloneableAny</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;_panel: &amp;Panel<br>) -&gt; Transition&lt;A&gt;</h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.panel_changed-2" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.panel_changed-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A, <br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut Panel<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.56.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Transition&lt;A&gt;&gt;</h4></div></summary><div class='docblock'><p>Called when something on the panel has changed. If a transition is returned, stop handling </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.panel_changed-2" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.panel_changed-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A, <br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut Panel<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.56.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Transition&lt;A&gt;&gt;</h4></div></summary><div class='docblock'><p>Called when something on the panel has changed. If a transition is returned, stop handling
the event and immediately apply the transition. <a href="#method.panel_changed">Read more</a></p> the event and immediately apply the transition. <a href="#method.panel_changed">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p>
@ -381,8 +381,8 @@ the event and immediately apply the transition. <a href="#method.panel_changed">
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-60" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#216-244" title="goto source code">[src]</a></div><a href="#method.draw-60" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;, app: &amp;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-60" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#216-244" title="goto source code">[src]</a></div><a href="#method.draw-60" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;, app: &amp;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-59" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#246-250" title="goto source code">[src]</a></div><a href="#method.on_destroy-59" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&amp;mut self, _: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-59" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#246-250" title="goto source code">[src]</a></div><a href="#method.on_destroy-59" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&amp;mut self, _: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-59" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-59" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&amp;self) -&gt; DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-59" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-59" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&amp;self) -&gt; DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-6" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#72-156" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-6" class="anchor"></a><h3 class="code-header in-band">impl State&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt; for <a class="struct" href="../debug/blockfinder/struct.Blockfinder.html" title="struct game::debug::blockfinder::Blockfinder">Blockfinder</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-6" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#73-150" title="goto source code">[src]</a></div><a href="#method.event-6" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&amp;mut self, ctx: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-6" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#89-173" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-6" class="anchor"></a><h3 class="code-header in-band">impl State&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt; for <a class="struct" href="../debug/blockfinder/struct.Blockfinder.html" title="struct game::debug::blockfinder::Blockfinder">Blockfinder</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-6" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#90-167" title="goto source code">[src]</a></div><a href="#method.event-6" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&amp;mut self, ctx: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-7" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#152-155" title="goto source code">[src]</a></div><a href="#method.draw-7" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;, _: &amp;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-7" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/debug/blockfinder.rs.html#169-172" title="goto source code">[src]</a></div><a href="#method.draw-7" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&amp;self, g: &amp;mut GfxCtx&lt;'_&gt;, _: &amp;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-6" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&amp;self) -&gt; DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-6" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&amp;self) -&gt; DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-6" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_destroy-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-6" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_destroy-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&amp;mut self, &amp;mut EventCtx&lt;'_&gt;, <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.reference.html">&amp;mut </a>A)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-60" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#286-294" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-60" class="anchor"></a><h3 class="code-header in-band">impl State&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt; for <a class="struct" href="../sandbox/struct.BackToMainMenu.html" title="struct game::sandbox::BackToMainMenu">BackToMainMenu</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-60" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#287-291" title="goto source code">[src]</a></div><a href="#method.event-60" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&amp;mut self, ctx: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-60" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#286-294" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-60" class="anchor"></a><h3 class="code-header in-band">impl State&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt; for <a class="struct" href="../sandbox/struct.BackToMainMenu.html" title="struct game::sandbox::BackToMainMenu">BackToMainMenu</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-60" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/mod.rs.html#287-291" title="goto source code">[src]</a></div><a href="#method.event-60" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&amp;mut self, ctx: &amp;mut EventCtx&lt;'_&gt;, app: &amp;mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -&gt; Transition&lt;<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>&gt;</h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>

View File

@ -0,0 +1,3 @@
<!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 `COLORS` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, COLORS"><title>COLORS in game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a></h2><div id="sidebar-vars" data-name="COLORS" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a>::<wbr><a class="constant" href="#">COLORS</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#15-22" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>const COLORS: <a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.array.html">[</a>Color<a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.array.html">; 6]</a>;</code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
<script src="../../../main.js"></script>
</body></html>

View File

@ -0,0 +1,3 @@
<!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 `MODIFIED` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, MODIFIED"><title>MODIFIED in game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a></h2><div id="sidebar-vars" data-name="MODIFIED" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a>::<wbr><a class="constant" href="#">MODIFIED</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#23" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>const MODIFIED: Color;</code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
<script src="../../../main.js"></script>
</body></html>

View File

@ -0,0 +1,3 @@
<!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 `TO_MERGE` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, TO_MERGE"><title>TO_MERGE in game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a></h2><div id="sidebar-vars" data-name="TO_MERGE" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a>::<wbr><a class="constant" href="#">TO_MERGE</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#24" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>const TO_MERGE: Color;</code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
<script src="../../../main.js"></script>
</body></html>

View File

@ -1,3 +1,3 @@
<!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 `make_panel` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, make_panel"><title>make_panel in game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a></h2><div id="sidebar-vars" data-name="make_panel" data-ty="fn" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a>::<wbr><a class="fn" href="#">make_panel</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#227-248" title="goto source code">[src]</a></span></h1><pre class="rust fn"><code>fn make_panel(ctx: &amp;mut EventCtx&lt;'_&gt;) -&gt; Panel</code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div> <!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 `make_panel` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, make_panel"><title>make_panel in game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a></h2><div id="sidebar-vars" data-name="make_panel" data-ty="fn" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a href="index.html">blockfinder</a>::<wbr><a class="fn" href="#">make_panel</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#244-265" title="goto source code">[src]</a></span></h1><pre class="rust fn"><code>fn make_panel(ctx: &amp;mut EventCtx&lt;'_&gt;) -&gt; Panel</code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
<script src="../../../main.js"></script> <script src="../../../main.js"></script>
</body></html> </body></html>

View File

@ -1,5 +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 `blockfinder` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, blockfinder"><title>game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module blockfinder</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="blockfinder" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a class="mod" href="#">blockfinder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#1-248" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> <!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 `blockfinder` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, blockfinder"><title>game::debug::blockfinder - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module blockfinder</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="blockfinder" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">debug</a>::<wbr><a class="mod" href="#">blockfinder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/debug/blockfinder.rs.html#1-265" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.Blockfinder.html" title="game::debug::blockfinder::Blockfinder struct">Blockfinder</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.Obj.html" title="game::debug::blockfinder::Obj struct">Obj</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.OneBlock.html" title="game::debug::blockfinder::OneBlock struct">OneBlock</a></div><div class="item-right docblock-short"></div></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2> <div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.Blockfinder.html" title="game::debug::blockfinder::Blockfinder struct">Blockfinder</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.Obj.html" title="game::debug::blockfinder::Obj struct">Obj</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.OneBlock.html" title="game::debug::blockfinder::OneBlock struct">OneBlock</a></div><div class="item-right docblock-short"></div></div><h2 id="constants" class="section-header"><a href="#constants">Constants</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="constant" href="constant.COLORS.html" title="game::debug::blockfinder::COLORS constant">COLORS</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="constant" href="constant.MODIFIED.html" title="game::debug::blockfinder::MODIFIED constant">MODIFIED</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="constant" href="constant.TO_MERGE.html" title="game::debug::blockfinder::TO_MERGE constant">TO_MERGE</a></div><div class="item-right docblock-short"></div></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="fn" href="fn.make_panel.html" title="game::debug::blockfinder::make_panel fn">make_panel</a></div><div class="item-right docblock-short"></div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div> <div class="item-table"><div class="item-left module-item"><a class="fn" href="fn.make_panel.html" title="game::debug::blockfinder::make_panel fn">make_panel</a></div><div class="item-right docblock-short"></div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
<script src="../../../main.js"></script> <script src="../../../main.js"></script>
</body></html> </body></html>

View File

@ -1 +1 @@
initSidebarItems({"fn":[["make_panel",""]],"struct":[["Blockfinder",""],["Obj",""],["OneBlock",""]]}); initSidebarItems({"constant":[["COLORS",""],["MODIFIED",""],["TO_MERGE",""]],"fn":[["make_panel",""]],"struct":[["Blockfinder",""],["Obj",""],["OneBlock",""]]});

File diff suppressed because one or more lines are too long

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="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in game::pregame::built_info - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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-f75313d249ca30eb/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.str.html">str</a> = r&quot;Thu, 28 Oct 2021 21:31:38 +0000&quot;;</code></pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p> <!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="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in game::pregame::built_info - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#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"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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-f75313d249ca30eb/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.56.0/std/primitive.str.html">str</a> = r&quot;Thu, 28 Oct 2021 22:24:56 +0000&quot;;</code></pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
</div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div> </div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
<script src="../../../main.js"></script> <script src="../../../main.js"></script>
</body></html> </body></html>

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 `block` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, block"><title>map_model::objects::block - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module block</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="block" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">objects</a>::<wbr><a class="mod" href="#">block</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/objects/block.rs.html#1-354" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> <!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 `block` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, block"><title>map_model::objects::block - 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><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module block</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="block" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">objects</a>::<wbr><a class="mod" href="#">block</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/objects/block.rs.html#1-392" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.Block.html" title="map_model::objects::block::Block struct">Block</a></div><div class="item-right docblock-short"><p>A block is defined by a perimeter that traces along the sides of roads. Inside the perimeter, <div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.Block.html" title="map_model::objects::block::Block struct">Block</a></div><div class="item-right docblock-short"><p>A block is defined by a perimeter that traces along the sides of roads. Inside the perimeter,
the block may contain buildings and interior roads. In the simple case, a block represents a the block may contain buildings and interior roads. In the simple case, a block represents a
single “city block”, with no interior roads. It may also cover a “neighborhood”, where the single “city block”, with no interior roads. It may also cover a “neighborhood”, where the

View File

@ -6,12 +6,12 @@ the block may contain buildings and interior roads. In the simple case, a block
single “city block”, with no interior roads. It may also cover a “neighborhood”, where the single “city block”, with no interior roads. It may also cover a “neighborhood”, where the
perimeter contains some “major” and the interior consists only of “minor” roads.</p> perimeter contains some “major” and the interior consists only of “minor” roads.</p>
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.perimeter" class="structfield small-section-header"><a href="#structfield.perimeter" class="anchor field"></a><code>perimeter: <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></code></span><span id="structfield.polygon" class="structfield small-section-header"><a href="#structfield.polygon" class="anchor field"></a><code>polygon: <a class="struct" href="../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a></code></span><div class="docblock"><p>The polygon covers the interior of the block.</p> </div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.perimeter" class="structfield small-section-header"><a href="#structfield.perimeter" class="anchor field"></a><code>perimeter: <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></code></span><span id="structfield.polygon" class="structfield small-section-header"><a href="#structfield.polygon" class="anchor field"></a><code>polygon: <a class="struct" href="../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a></code></span><div class="docblock"><p>The polygon covers the interior of the block.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#192-354" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#196-198" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="../lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single </div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#230-392" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#234-236" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="../lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
block, with no interior roads. This will fail if a map boundary is reached. The results are block, with no interior roads. This will fail if a map boundary is reached. The results are
unusual when crossing the entrance to a tunnel or bridge.</p> unusual when crossing the entrance to a tunnel or bridge.</p>
</div></details><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#200-286" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.find_all_single_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#290-315" title="goto source code">[src]</a></div><a href="#method.find_all_single_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_all_single_blocks" class="fnname">find_all_single_blocks</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>This calculates all single blocks for the entire map. The resulting list does not cover </div></details><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#238-324" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.find_all_single_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#328-353" title="goto source code">[src]</a></div><a href="#method.find_all_single_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_all_single_blocks" class="fnname">find_all_single_blocks</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>This calculates all single blocks for the entire map. The resulting list does not cover
roads near the map boundary.</p> roads near the map boundary.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#320-353" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, list: <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Try to merge all given blocks. If successful, only one block will be returned. Blocks are </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#358-391" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(map: &amp;<a class="struct" href="../../struct.Map.html" title="struct map_model::Map">Map</a>, list: <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Try to merge all given blocks. If successful, only one block will be returned. Blocks are
never “destroyed” if not merged, theyll appear in the results. never “destroyed” if not merged, theyll appear in the results.
TODO This may not handle all possible merges yet, the order is brittle…</p> TODO This may not handle all possible merges yet, the order is brittle…</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>

File diff suppressed because one or more lines are too long

View File

@ -6,12 +6,12 @@ the block may contain buildings and interior roads. In the simple case, a block
single “city block”, with no interior roads. It may also cover a “neighborhood”, where the single “city block”, with no interior roads. It may also cover a “neighborhood”, where the
perimeter contains some “major” and the interior consists only of “minor” roads.</p> perimeter contains some “major” and the interior consists only of “minor” roads.</p>
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.perimeter" class="structfield small-section-header"><a href="#structfield.perimeter" class="anchor field"></a><code>perimeter: <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></code></span><span id="structfield.polygon" class="structfield small-section-header"><a href="#structfield.polygon" class="anchor field"></a><code>polygon: <a class="struct" href="../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a></code></span><div class="docblock"><p>The polygon covers the interior of the block.</p> </div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.perimeter" class="structfield small-section-header"><a href="#structfield.perimeter" class="anchor field"></a><code>perimeter: <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a></code></span><span id="structfield.polygon" class="structfield small-section-header"><a href="#structfield.polygon" class="anchor field"></a><code>polygon: <a class="struct" href="../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a></code></span><div class="docblock"><p>The polygon covers the interior of the block.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#192-354" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#196-198" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="objects/lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single </div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#230-392" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.single_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#234-236" title="goto source code">[src]</a></div><a href="#method.single_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.single_block" class="fnname">single_block</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, start: <a class="struct" href="objects/lane/struct.LaneID.html" title="struct map_model::objects::lane::LaneID">LaneID</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Starting at any lane, snap to the nearest side of that road, then begin tracing a single
block, with no interior roads. This will fail if a map boundary is reached. The results are block, with no interior roads. This will fail if a map boundary is reached. The results are
unusual when crossing the entrance to a tunnel or bridge.</p> unusual when crossing the entrance to a tunnel or bridge.</p>
</div></details><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#200-286" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.find_all_single_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#290-315" title="goto source code">[src]</a></div><a href="#method.find_all_single_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_all_single_blocks" class="fnname">find_all_single_blocks</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>This calculates all single blocks for the entire map. The resulting list does not cover </div></details><div id="method.from_perimeter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#238-324" title="goto source code">[src]</a></div><a href="#method.from_perimeter" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_perimeter" class="fnname">from_perimeter</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, perimeter: <a class="struct" href="objects/block/struct.Perimeter.html" title="struct map_model::objects::block::Perimeter">Perimeter</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.41/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.find_all_single_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#328-353" title="goto source code">[src]</a></div><a href="#method.find_all_single_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find_all_single_blocks" class="fnname">find_all_single_blocks</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>This calculates all single blocks for the entire map. The resulting list does not cover
roads near the map boundary.</p> roads near the map boundary.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#320-353" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, list: <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Try to merge all given blocks. If successful, only one block will be returned. Blocks are </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.merge_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#358-391" title="goto source code">[src]</a></div><a href="#method.merge_all" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.merge_all" class="fnname">merge_all</a>(map: &amp;<a class="struct" href="struct.Map.html" title="struct map_model::Map">Map</a>, list: <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.56.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a>&gt;</h4></div></summary><div class="docblock"><p>Try to merge all given blocks. If successful, only one block will be returned. Blocks are
never “destroyed” if not merged, theyll appear in the results. never “destroyed” if not merged, theyll appear in the results.
TODO This may not handle all possible merges yet, the order is brittle…</p> TODO This may not handle all possible merges yet, the order is brittle…</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/map_model/objects/block.rs.html#15" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="objects/block/struct.Block.html" title="struct map_model::objects::block::Block">Block</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.56.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -246,6 +246,23 @@
<span id="246">246</span> <span id="246">246</span>
<span id="247">247</span> <span id="247">247</span>
<span id="248">248</span> <span id="248">248</span>
<span id="249">249</span>
<span id="250">250</span>
<span id="251">251</span>
<span id="252">252</span>
<span id="253">253</span>
<span id="254">254</span>
<span id="255">255</span>
<span id="256">256</span>
<span id="257">257</span>
<span id="258">258</span>
<span id="259">259</span>
<span id="260">260</span>
<span id="261">261</span>
<span id="262">262</span>
<span id="263">263</span>
<span id="264">264</span>
<span id="265">265</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>};
<span class="kw">use</span> <span class="ident">geom::Distance</span>; <span class="kw">use</span> <span class="ident">geom::Distance</span>;
@ -260,6 +277,17 @@
<span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::app</span>::{<span class="ident">App</span>, <span class="ident">Transition</span>}; <span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::app</span>::{<span class="ident">App</span>, <span class="ident">Transition</span>};
<span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::debug::polygons</span>; <span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::debug::polygons</span>;
<span class="kw">const</span> <span class="ident">COLORS</span>: [<span class="ident">Color</span>; <span class="number">6</span>] <span class="op">=</span> [
<span class="ident">Color::BLUE</span>,
<span class="ident">Color::YELLOW</span>,
<span class="ident">Color::GREEN</span>,
<span class="ident">Color::PURPLE</span>,
<span class="ident">Color::PINK</span>,
<span class="ident">Color::ORANGE</span>,
];
<span class="kw">const</span> <span class="ident">MODIFIED</span>: <span class="ident">Color</span> <span class="op">=</span> <span class="ident">Color::RED</span>;
<span class="kw">const</span> <span class="ident">TO_MERGE</span>: <span class="ident">Color</span> <span class="op">=</span> <span class="ident">Color::CYAN</span>;
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Blockfinder</span> { <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Blockfinder</span> {
<span class="ident">panel</span>: <span class="ident">Panel</span>, <span class="ident">panel</span>: <span class="ident">Panel</span>,
<span class="ident">id_counter</span>: <span class="ident">usize</span>, <span class="ident">id_counter</span>: <span class="ident">usize</span>,
@ -283,9 +311,16 @@
}; };
<span class="ident">ctx</span>.<span class="ident">loading_screen</span>(<span class="string">&quot;calculate all blocks&quot;</span>, <span class="op">|</span><span class="ident">ctx</span>, <span class="kw">_</span><span class="op">|</span> { <span class="ident">ctx</span>.<span class="ident">loading_screen</span>(<span class="string">&quot;calculate all blocks&quot;</span>, <span class="op">|</span><span class="ident">ctx</span>, <span class="kw">_</span><span class="op">|</span> {
<span class="kw">for</span> <span class="ident">block</span> <span class="kw">in</span> <span class="ident">Block::find_all_single_blocks</span>(<span class="kw-2">&amp;</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>) { <span class="kw">let</span> <span class="ident">blocks</span> <span class="op">=</span> <span class="ident">Block::find_all_single_blocks</span>(<span class="kw-2">&amp;</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>);
<span class="kw">let</span> <span class="ident">colors</span> <span class="op">=</span> <span class="ident">Perimeter::calculate_coloring</span>(
<span class="ident">blocks</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="kw-2">&amp;</span><span class="ident">x</span>.<span class="ident">perimeter</span>).<span class="ident">collect</span>(),
<span class="ident">COLORS</span>.<span class="ident">len</span>(),
)
.<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="op">|</span> (<span class="number">0</span>..<span class="ident">blocks</span>.<span class="ident">len</span>()).<span class="ident">collect</span>());
<span class="kw">for</span> (<span class="ident">block</span>, <span class="ident">color_idx</span>) <span class="kw">in</span> <span class="ident">blocks</span>.<span class="ident">into_iter</span>().<span class="ident">zip</span>(<span class="ident">colors</span>.<span class="ident">into_iter</span>()) {
<span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="ident">state</span>.<span class="ident">new_id</span>(); <span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="ident">state</span>.<span class="ident">new_id</span>();
<span class="ident">state</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="prelude-val">None</span>, <span class="ident">block</span>); <span class="ident">state</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="ident">COLORS</span>[<span class="ident">color_idx</span> <span class="op">%</span> <span class="ident">COLORS</span>.<span class="ident">len</span>()], <span class="ident">block</span>);
} }
}); });
<span class="ident">state</span>.<span class="ident">world</span>.<span class="ident">initialize_hover</span>(<span class="ident">ctx</span>); <span class="ident">state</span>.<span class="ident">world</span>.<span class="ident">initialize_hover</span>(<span class="ident">ctx</span>);
@ -298,8 +333,7 @@
<span class="ident">id</span> <span class="ident">id</span>
} }
<span class="kw">fn</span> <span class="ident">add_block</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">ctx</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">id</span>: <span class="ident">Obj</span>, <span class="ident">color</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Color</span><span class="op">&gt;</span>, <span class="ident">block</span>: <span class="ident">Block</span>) { <span class="kw">fn</span> <span class="ident">add_block</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">ctx</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">id</span>: <span class="ident">Obj</span>, <span class="ident">color</span>: <span class="ident">Color</span>, <span class="ident">block</span>: <span class="ident">Block</span>) {
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">color</span>.<span class="ident">unwrap_or</span>(<span class="ident">Color::RED</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">obj</span> <span class="op">=</span> <span class="self">self</span> <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">obj</span> <span class="op">=</span> <span class="self">self</span>
.<span class="ident">world</span> .<span class="ident">world</span>
.<span class="ident">add</span>(<span class="ident">id</span>) .<span class="ident">add</span>(<span class="ident">id</span>)
@ -335,7 +369,7 @@
} }
<span class="kw">for</span> <span class="ident">block</span> <span class="kw">in</span> <span class="ident">Block::merge_all</span>(<span class="kw-2">&amp;</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>, <span class="ident">blocks</span>) { <span class="kw">for</span> <span class="ident">block</span> <span class="kw">in</span> <span class="ident">Block::merge_all</span>(<span class="kw-2">&amp;</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>, <span class="ident">blocks</span>) {
<span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">new_id</span>(); <span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">new_id</span>();
<span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="prelude-val">None</span>, <span class="ident">block</span>); <span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="ident">MODIFIED</span>, <span class="ident">block</span>);
} }
<span class="kw">return</span> <span class="ident">Transition::Keep</span>; <span class="kw">return</span> <span class="ident">Transition::Keep</span>;
} }
@ -361,12 +395,11 @@
<span class="comment">// Until we can actually do the merge, just color the partition to show results</span> <span class="comment">// Until we can actually do the merge, just color the partition to show results</span>
<span class="kw">for</span> (<span class="ident">color_idx</span>, <span class="ident">perimeters</span>) <span class="kw">in</span> <span class="ident">partitions</span>.<span class="ident">into_iter</span>().<span class="ident">enumerate</span>() { <span class="kw">for</span> (<span class="ident">color_idx</span>, <span class="ident">perimeters</span>) <span class="kw">in</span> <span class="ident">partitions</span>.<span class="ident">into_iter</span>().<span class="ident">enumerate</span>() {
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">COLORS</span>[<span class="ident">color_idx</span> <span class="op">%</span> <span class="ident">COLORS</span>.<span class="ident">len</span>()];
[<span class="ident">Color::RED</span>, <span class="ident">Color::YELLOW</span>, <span class="ident">Color::GREEN</span>, <span class="ident">Color::PURPLE</span>][<span class="ident">color_idx</span> <span class="op">%</span> <span class="number">4</span>];
<span class="kw">for</span> <span class="ident">perimeter</span> <span class="kw">in</span> <span class="ident">perimeters</span> { <span class="kw">for</span> <span class="ident">perimeter</span> <span class="kw">in</span> <span class="ident">perimeters</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">block</span>) <span class="op">=</span> <span class="ident">perimeter</span>.<span class="ident">to_block</span>(<span class="ident">map</span>) { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">block</span>) <span class="op">=</span> <span class="ident">perimeter</span>.<span class="ident">to_block</span>(<span class="ident">map</span>) {
<span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">new_id</span>(); <span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">new_id</span>();
<span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="prelude-val">Some</span>(<span class="ident">color</span>), <span class="ident">block</span>); <span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="ident">color</span>, <span class="ident">block</span>);
} }
} }
} }
@ -380,13 +413,14 @@
<span class="self">self</span>.<span class="ident">to_merge</span>.<span class="ident">insert</span>(<span class="ident">id</span>); <span class="self">self</span>.<span class="ident">to_merge</span>.<span class="ident">insert</span>(<span class="ident">id</span>);
<span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">blocks</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>).<span class="ident">unwrap</span>(); <span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">blocks</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>).<span class="ident">unwrap</span>();
<span class="self">self</span>.<span class="ident">world</span>.<span class="ident">delete_before_replacement</span>(<span class="ident">id</span>); <span class="self">self</span>.<span class="ident">world</span>.<span class="ident">delete_before_replacement</span>(<span class="ident">id</span>);
<span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="prelude-val">Some</span>(<span class="ident">Color::CYAN</span>), <span class="ident">block</span>); <span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="ident">TO_MERGE</span>, <span class="ident">block</span>);
} }
<span class="ident">WorldOutcome::Keypress</span>(<span class="string">&quot;remove from merge set&quot;</span>, <span class="ident">id</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="ident">WorldOutcome::Keypress</span>(<span class="string">&quot;remove from merge set&quot;</span>, <span class="ident">id</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="self">self</span>.<span class="ident">to_merge</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>); <span class="self">self</span>.<span class="ident">to_merge</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>);
<span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">blocks</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>).<span class="ident">unwrap</span>(); <span class="kw">let</span> <span class="ident">block</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">blocks</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>).<span class="ident">unwrap</span>();
<span class="self">self</span>.<span class="ident">world</span>.<span class="ident">delete_before_replacement</span>(<span class="ident">id</span>); <span class="self">self</span>.<span class="ident">world</span>.<span class="ident">delete_before_replacement</span>(<span class="ident">id</span>);
<span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="prelude-val">None</span>, <span class="ident">block</span>); <span class="comment">// We&#39;ll lose the original coloring, oh well</span>
<span class="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">id</span>, <span class="ident">MODIFIED</span>, <span class="ident">block</span>);
} }
<span class="ident">WorldOutcome::ClickedObject</span>(<span class="ident">id</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="ident">WorldOutcome::ClickedObject</span>(<span class="ident">id</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">return</span> <span class="ident">Transition::Push</span>(<span class="ident">OneBlock::new_state</span>(<span class="ident">ctx</span>, <span class="self">self</span>.<span class="ident">blocks</span>[<span class="kw-2">&amp;</span><span class="ident">id</span>].<span class="ident">clone</span>())); <span class="kw">return</span> <span class="ident">Transition::Push</span>(<span class="ident">OneBlock::new_state</span>(<span class="ident">ctx</span>, <span class="self">self</span>.<span class="ident">blocks</span>[<span class="kw-2">&amp;</span><span class="ident">id</span>].<span class="ident">clone</span>()));

View File

@ -174,7 +174,7 @@
<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">r&quot;rustdoc 1.56.0 (09c42c458 2021-10-18)&quot;</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">r&quot;rustdoc 1.56.0 (09c42c458 2021-10-18)&quot;</span>;
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The build time in RFC2822, UTC.&quot;#</span>]</span> <span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The build time in RFC2822, UTC.&quot;#</span>]</span>
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span> <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</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">r&quot;Thu, 28 Oct 2021 21:31:38 +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">r&quot;Thu, 28 Oct 2021 22:24:56 +0000&quot;</span>;
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The target architecture, given by `CARGO_CFG_TARGET_ARCH`.&quot;#</span>]</span> <span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The target architecture, given by `CARGO_CFG_TARGET_ARCH`.&quot;#</span>]</span>
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span> <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</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">r&quot;x86_64&quot;</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">r&quot;x86_64&quot;</span>;

View File

@ -352,6 +352,44 @@
<span id="352">352</span> <span id="352">352</span>
<span id="353">353</span> <span id="353">353</span>
<span id="354">354</span> <span id="354">354</span>
<span id="355">355</span>
<span id="356">356</span>
<span id="357">357</span>
<span id="358">358</span>
<span id="359">359</span>
<span id="360">360</span>
<span id="361">361</span>
<span id="362">362</span>
<span id="363">363</span>
<span id="364">364</span>
<span id="365">365</span>
<span id="366">366</span>
<span id="367">367</span>
<span id="368">368</span>
<span id="369">369</span>
<span id="370">370</span>
<span id="371">371</span>
<span id="372">372</span>
<span id="373">373</span>
<span id="374">374</span>
<span id="375">375</span>
<span id="376">376</span>
<span id="377">377</span>
<span id="378">378</span>
<span id="379">379</span>
<span id="380">380</span>
<span id="381">381</span>
<span id="382">382</span>
<span id="383">383</span>
<span id="384">384</span>
<span id="385">385</span>
<span id="386">386</span>
<span id="387">387</span>
<span id="388">388</span>
<span id="389">389</span>
<span id="390">390</span>
<span id="391">391</span>
<span id="392">392</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>};
<span class="kw">use</span> <span class="ident">anyhow::Result</span>; <span class="kw">use</span> <span class="ident">anyhow::Result</span>;
@ -538,6 +576,44 @@
<span class="ident">results</span> <span class="ident">results</span>
} }
<span class="doccomment">/// Assign each perimeter one of `num_colors`, such that no two adjacent perimeters share the</span>
<span class="doccomment">/// same color. May fail. The resulting colors are expressed as `[0, num_colors)`.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">calculate_coloring</span>(<span class="ident">input</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">Perimeter</span><span class="op">&gt;</span>, <span class="ident">num_colors</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">road_to_perimeters</span>: <span class="ident">HashMap</span><span class="op">&lt;</span><span class="ident">RoadID</span>, <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">HashMap::new</span>();
<span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">perimeter</span>) <span class="kw">in</span> <span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">perimeter</span>.<span class="ident">roads</span> {
<span class="ident">road_to_perimeters</span>
.<span class="ident">entry</span>(<span class="ident">id</span>.<span class="ident">road</span>)
.<span class="ident">or_insert_with</span>(<span class="ident">Vec::new</span>)
.<span class="ident">push</span>(<span class="ident">idx</span>);
}
}
<span class="comment">// Greedily fill out a color for each perimeter, in the same order as the input</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">assigned_colors</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
<span class="kw">for</span> (<span class="ident">this_idx</span>, <span class="ident">perimeter</span>) <span class="kw">in</span> <span class="ident">input</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">available_colors</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">bool</span><span class="op">&gt;</span> <span class="op">=</span>
<span class="ident">std::iter::repeat</span>(<span class="bool-val">true</span>).<span class="ident">take</span>(<span class="ident">num_colors</span>).<span class="ident">collect</span>();
<span class="comment">// Find all neighbors</span>
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">perimeter</span>.<span class="ident">roads</span> {
<span class="kw">for</span> <span class="ident">other_idx</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">road_to_perimeters</span>[<span class="kw-2">&amp;</span><span class="ident">id</span>.<span class="ident">road</span>] {
<span class="comment">// We assign colors in order, so any neighbor index smaller than us has been</span>
<span class="comment">// chosen</span>
<span class="kw">if</span> <span class="kw-2">*</span><span class="ident">other_idx</span> <span class="op">&lt;</span> <span class="ident">this_idx</span> {
<span class="ident">available_colors</span>[<span class="ident">assigned_colors</span>[<span class="kw-2">*</span><span class="ident">other_idx</span>]] <span class="op">=</span> <span class="bool-val">false</span>;
}
}
}
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">color</span>) <span class="op">=</span> <span class="ident">available_colors</span>.<span class="ident">iter</span>().<span class="ident">position</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">x</span>) {
<span class="ident">assigned_colors</span>.<span class="ident">push</span>(<span class="ident">color</span>);
} <span class="kw">else</span> {
<span class="comment">// Too few colors?</span>
<span class="kw">return</span> <span class="prelude-val">None</span>;
}
}
<span class="prelude-val">Some</span>(<span class="ident">assigned_colors</span>)
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">to_block</span>(<span class="self">self</span>, <span class="ident">map</span>: <span class="kw-2">&amp;</span><span class="ident">Map</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Block</span><span class="op">&gt;</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">to_block</span>(<span class="self">self</span>, <span class="ident">map</span>: <span class="kw-2">&amp;</span><span class="ident">Map</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Block</span><span class="op">&gt;</span> {
<span class="ident">Block::from_perimeter</span>(<span class="ident">map</span>, <span class="self">self</span>) <span class="ident">Block::from_perimeter</span>(<span class="ident">map</span>, <span class="self">self</span>)
} }