This commit is contained in:
dabreegster 2021-11-02 23:40:39 +00:00
parent c3a351e7f4
commit 636b97addf
19 changed files with 125 additions and 75 deletions

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.1/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.1/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.1/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.1/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#269-313" 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#270-303" 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.1/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#288-332" 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#289-322" 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.1/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#305-308" 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#324-327" 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#310-312" 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.1/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.1/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.1/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#329-331" 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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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#115-239" 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#116-233" 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#134-258" 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#135-252" 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#235-238" 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#254-257" 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.1/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.1/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

@ -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#315-349" 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#334-368" 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,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 `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-349" 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-368" 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="constants" class="section-header"><a href="#constants">Constants</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="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>

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-1cadd2d85de266ec/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.1/std/primitive.str.html">str</a> = r&quot;Tue, 02 Nov 2021 20:59:22 +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-1cadd2d85de266ec/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.1/std/primitive.str.html">str</a> = r&quot;Tue, 02 Nov 2021 23:39: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>
</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>

File diff suppressed because one or more lines are too long

View File

@ -347,6 +347,25 @@
<span id="347">347</span> <span id="347">347</span>
<span id="348">348</span> <span id="348">348</span>
<span id="349">349</span> <span id="349">349</span>
<span id="350">350</span>
<span id="351">351</span>
<span id="352">352</span>
<span id="353">353</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>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">BTreeSet</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">BTreeSet</span>};
<span class="kw">use</span> <span class="ident">abstutil::Timer</span>; <span class="kw">use</span> <span class="ident">abstutil::Timer</span>;
@ -355,8 +374,8 @@
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">Block</span>, <span class="ident">PathConstraints</span>, <span class="ident">Perimeter</span>}; <span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">Block</span>, <span class="ident">PathConstraints</span>, <span class="ident">Perimeter</span>};
<span class="kw">use</span> <span class="ident">widgetry::mapspace</span>::{<span class="ident">ObjectID</span>, <span class="ident">World</span>, <span class="ident">WorldOutcome</span>}; <span class="kw">use</span> <span class="ident">widgetry::mapspace</span>::{<span class="ident">ObjectID</span>, <span class="ident">World</span>, <span class="ident">WorldOutcome</span>};
<span class="kw">use</span> <span class="ident">widgetry</span>::{ <span class="kw">use</span> <span class="ident">widgetry</span>::{
<span class="ident">Color</span>, <span class="ident">EventCtx</span>, <span class="ident">GfxCtx</span>, <span class="ident">HorizontalAlignment</span>, <span class="ident">Key</span>, <span class="ident">Line</span>, <span class="ident">Outcome</span>, <span class="ident">Panel</span>, <span class="ident">SimpleState</span>, <span class="ident">State</span>, <span class="ident">Color</span>, <span class="ident">EventCtx</span>, <span class="ident">GeomBatch</span>, <span class="ident">GfxCtx</span>, <span class="ident">HorizontalAlignment</span>, <span class="ident">Key</span>, <span class="ident">Line</span>, <span class="ident">Outcome</span>, <span class="ident">Panel</span>,
<span class="ident">TextExt</span>, <span class="ident">VerticalAlignment</span>, <span class="ident">Widget</span>, <span class="ident">SimpleState</span>, <span class="ident">State</span>, <span class="ident">Text</span>, <span class="ident">TextExt</span>, <span class="ident">VerticalAlignment</span>, <span class="ident">Widget</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>::app</span>::{<span class="ident">App</span>, <span class="ident">Transition</span>};
@ -411,13 +430,32 @@
<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="ident">Color</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">app</span>: <span class="kw-2">&amp;</span><span class="ident">App</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="comment">// Label the order of the perimeter roads while hovering</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hovered</span> <span class="op">=</span> <span class="ident">GeomBatch::from</span>(<span class="macro">vec!</span>[(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.5</span>), <span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())]);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">outline</span>) <span class="op">=</span> <span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">to_outline</span>(<span class="ident">Distance::meters</span>(<span class="number">5.0</span>)) {
<span class="ident">hovered</span>.<span class="ident">push</span>(<span class="ident">Color::BLACK</span>, <span class="ident">outline</span>);
}
<span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">id</span>) <span class="kw">in</span> <span class="ident">block</span>.<span class="ident">perimeter</span>.<span class="ident">roads</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>().<span class="ident">skip</span>(<span class="number">1</span>) {
<span class="ident">hovered</span>.<span class="ident">append</span>(
<span class="ident">Text::from</span>(<span class="ident">Line</span>(<span class="macro">format!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">idx</span>)).<span class="ident">fg</span>(<span class="ident">Color::RED</span>))
.<span class="ident">bg</span>(<span class="ident">Color::BLACK</span>)
.<span class="ident">render_autocropped</span>(<span class="ident">ctx</span>)
.<span class="ident">scale</span>(<span class="number">1.0</span>)
.<span class="ident">centered_on</span>(
<span class="ident">id</span>.<span class="ident">get_outermost_lane</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">lane_center_pts</span>
.<span class="ident">middle</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>)
.<span class="ident">hitbox</span>(<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>()) .<span class="ident">hitbox</span>(<span class="ident">block</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>())
.<span class="ident">draw_color</span>(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.5</span>)) .<span class="ident">draw_color</span>(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.5</span>))
.<span class="ident">hover_outline</span>(<span class="ident">Color::BLACK</span>, <span class="ident">Distance::meters</span>(<span class="number">5.0</span>)) .<span class="ident">draw_hovered</span>(<span class="ident">hovered</span>)
.<span class="ident">clickable</span>(); .<span class="ident">clickable</span>();
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">to_merge</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>) { <span class="kw">if</span> <span class="self">self</span>.<span class="ident">to_merge</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>) {
<span class="ident">obj</span> <span class="op">=</span> <span class="ident">obj</span>.<span class="ident">hotkey</span>(<span class="ident">Key::Space</span>, <span class="string">&quot;remove from merge set&quot;</span>) <span class="ident">obj</span> <span class="op">=</span> <span class="ident">obj</span>.<span class="ident">hotkey</span>(<span class="ident">Key::Space</span>, <span class="string">&quot;remove from merge set&quot;</span>)
@ -456,7 +494,7 @@
<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">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="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="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="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">app</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>);
} }
} }
} }
@ -488,9 +526,9 @@
<span class="comment">// merge set</span> <span class="comment">// merge set</span>
<span class="kw">if</span> <span class="ident">debug</span> { <span class="kw">if</span> <span class="ident">debug</span> {
<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="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="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">id</span>, <span class="ident">TO_MERGE</span>, <span class="ident">block</span>);
} <span class="kw">else</span> { } <span class="kw">else</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="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">app</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>;
@ -504,7 +542,7 @@
.<span class="ident">expect</span>(<span class="string">&quot;collapsing deadends broke the polygon shape&quot;</span>); .<span class="ident">expect</span>(<span class="string">&quot;collapsing deadends broke the polygon shape&quot;</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="comment">// We&#39;ll lose the original coloring, oh well</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="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">id</span>, <span class="ident">MODIFIED</span>, <span class="ident">block</span>);
} }
} }
<span class="string">&quot;Classify neighborhoods&quot;</span> <span class="op">|</span> <span class="string">&quot;Auto-merge all neighborhoods&quot;</span> <span class="op">=</span><span class="op">&gt;</span> { <span class="string">&quot;Classify neighborhoods&quot;</span> <span class="op">|</span> <span class="string">&quot;Auto-merge all neighborhoods&quot;</span> <span class="op">=</span><span class="op">&gt;</span> {
@ -545,7 +583,7 @@
<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="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">app</span>, <span class="ident">id</span>, <span class="ident">color</span>, <span class="ident">block</span>);
} }
} }
} }
@ -563,14 +601,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="ident">TO_MERGE</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">app</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="comment">// We&#39;ll lose the original coloring, oh well</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="self">self</span>.<span class="ident">add_block</span>(<span class="ident">ctx</span>, <span class="ident">app</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.1 (59eed8a2a 2021-11-01)&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.1 (59eed8a2a 2021-11-01)&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;Tue, 02 Nov 2021 20:59:22 +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;Tue, 02 Nov 2021 23:39:38 +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

@ -527,6 +527,12 @@
<span id="527">527</span> <span id="527">527</span>
<span id="528">528</span> <span id="528">528</span>
<span id="529">529</span> <span id="529">529</span>
<span id="530">530</span>
<span id="531">531</span>
<span id="532">532</span>
<span id="533">533</span>
<span id="534">534</span>
<span id="535">535</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections::HashMap</span>; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections::HashMap</span>;
<span class="kw">use</span> <span class="ident">std::fmt::Debug</span>; <span class="kw">use</span> <span class="ident">std::fmt::Debug</span>;
<span class="kw">use</span> <span class="ident">std::hash::Hash</span>; <span class="kw">use</span> <span class="ident">std::hash::Hash</span>;
@ -701,6 +707,12 @@
.<span class="ident">to_outline</span>(<span class="ident">thickness</span>) .<span class="ident">to_outline</span>(<span class="ident">thickness</span>)
{ {
<span class="ident">draw</span> <span class="op">=</span> <span class="ident">draw</span>.<span class="ident">push</span>(<span class="ident">color</span>, <span class="ident">p</span>); <span class="ident">draw</span> <span class="op">=</span> <span class="ident">draw</span>.<span class="ident">push</span>(<span class="ident">color</span>, <span class="ident">p</span>);
} <span class="kw">else</span> {
<span class="macro">warn!</span>(
<span class="string">&quot;Can&#39;t hover_outline for {:?}. Falling back to a colored polygon&quot;</span>,
<span class="self">self</span>.<span class="ident">id</span>
);
<span class="ident">draw</span> <span class="op">=</span> <span class="ident">GeomBatch::from</span>(<span class="macro">vec!</span>[(<span class="ident">color</span>, <span class="self">self</span>.<span class="ident">hitbox</span>.<span class="ident">clone</span>().<span class="ident">unwrap</span>())]).<span class="ident">into</span>();
} }
<span class="self">self</span>.<span class="ident">draw_hovered</span>(<span class="ident">draw</span>) <span class="self">self</span>.<span class="ident">draw_hovered</span>(<span class="ident">draw</span>)
} }

File diff suppressed because one or more lines are too long

View File

@ -6,26 +6,26 @@
dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;, dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;,
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <code>World</code> manages objects that exist in “map-space”, the zoomable and pannable canvas. These }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <code>World</code> manages objects that exist in “map-space”, the zoomable and pannable canvas. These
objects can be drawn, hovered on, clicked, dragged, etc.</p> objects can be drawn, hovered on, clicked, dragged, etc.</p>
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.objects" class="structfield small-section-header"><a href="#structfield.objects" class="anchor field"></a><code>objects: <a class="struct" href="https://doc.rust-lang.org/1.56.1/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a>&lt;ID, <a class="struct" href="world/struct.Object.html" title="struct widgetry::mapspace::world::Object">Object</a>&lt;ID&gt;&gt;</code></span><span id="structfield.quadtree" class="structfield small-section-header"><a href="#structfield.quadtree" class="anchor field"></a><code>quadtree: QuadTree&lt;ID&gt;</code></span><span id="structfield.draw_master_batches" class="structfield small-section-header"><a href="#structfield.draw_master_batches" class="anchor field"></a><code>draw_master_batches: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.ToggleZoomed.html" title="struct widgetry::mapspace::ToggleZoomed">ToggleZoomed</a>&gt;</code></span><span id="structfield.hovering" class="structfield small-section-header"><a href="#structfield.hovering" class="anchor field"></a><code>hovering: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</code></span><span id="structfield.dragging_from" class="structfield small-section-header"><a href="#structfield.dragging_from" class="anchor field"></a><code>dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;</code></span><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/widgetry/mapspace/world.rs.html#263-512" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;ID:&nbsp;<a class="trait" href="world/trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a>&gt; <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unbounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#265-278" title="goto source code">[src]</a></div><a href="#method.unbounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.unbounded" class="fnname">unbounded</a>() -&gt; <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist anywhere from (0, 0) to the max f64.</p> </div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.objects" class="structfield small-section-header"><a href="#structfield.objects" class="anchor field"></a><code>objects: <a class="struct" href="https://doc.rust-lang.org/1.56.1/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a>&lt;ID, <a class="struct" href="world/struct.Object.html" title="struct widgetry::mapspace::world::Object">Object</a>&lt;ID&gt;&gt;</code></span><span id="structfield.quadtree" class="structfield small-section-header"><a href="#structfield.quadtree" class="anchor field"></a><code>quadtree: QuadTree&lt;ID&gt;</code></span><span id="structfield.draw_master_batches" class="structfield small-section-header"><a href="#structfield.draw_master_batches" class="anchor field"></a><code>draw_master_batches: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="struct.ToggleZoomed.html" title="struct widgetry::mapspace::ToggleZoomed">ToggleZoomed</a>&gt;</code></span><span id="structfield.hovering" class="structfield small-section-header"><a href="#structfield.hovering" class="anchor field"></a><code>hovering: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</code></span><span id="structfield.dragging_from" class="structfield small-section-header"><a href="#structfield.dragging_from" class="anchor field"></a><code>dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;</code></span><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/widgetry/mapspace/world.rs.html#269-518" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;ID:&nbsp;<a class="trait" href="world/trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a>&gt; <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unbounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#271-284" title="goto source code">[src]</a></div><a href="#method.unbounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.unbounded" class="fnname">unbounded</a>() -&gt; <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist anywhere from (0, 0) to the max f64.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.bounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#281-291" title="goto source code">[src]</a></div><a href="#method.bounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.bounded" class="fnname">bounded</a>(bounds: &amp;<a class="struct" href="../../geom/bounds/struct.Bounds.html" title="struct geom::bounds::Bounds">Bounds</a>) -&gt; <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist in the provided rectangular boundary.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.bounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#287-297" title="goto source code">[src]</a></div><a href="#method.bounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.bounded" class="fnname">bounded</a>(bounds: &amp;<a class="struct" href="../../geom/bounds/struct.Bounds.html" title="struct geom::bounds::Bounds">Bounds</a>) -&gt; <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist in the provided rectangular boundary.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#295-310" title="goto source code">[src]</a></div><a href="#method.add" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add" class="fnname">add</a>(&amp;mut self, id: ID) -&gt; <a class="struct" href="world/struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, ID&gt;</h4></div></summary><div class="docblock"><p>Start adding an object to the <code>World</code>. The caller should specify the object with methods on </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#301-316" title="goto source code">[src]</a></div><a href="#method.add" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add" class="fnname">add</a>(&amp;mut self, id: ID) -&gt; <a class="struct" href="world/struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, ID&gt;</h4></div></summary><div class="docblock"><p>Start adding an object to the <code>World</code>. The caller should specify the object with methods on
<code>ObjectBuilder</code>, then call <code>build</code>.</p> <code>ObjectBuilder</code>, then call <code>build</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#314-323" title="goto source code">[src]</a></div><a href="#method.delete" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete" class="fnname">delete</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object. Not idempotent this will panic if the object doesnt exist. Will panic </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#320-329" title="goto source code">[src]</a></div><a href="#method.delete" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete" class="fnname">delete</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object. Not idempotent this will panic if the object doesnt exist. Will panic
if the object is deleted in the middle of being dragged.</p> if the object is deleted in the middle of being dragged.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete_before_replacement" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#327-337" title="goto source code">[src]</a></div><a href="#method.delete_before_replacement" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete_before_replacement" class="fnname">delete_before_replacement</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object, with the promise to recreate it with the same ID before the next call to </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete_before_replacement" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#333-343" title="goto source code">[src]</a></div><a href="#method.delete_before_replacement" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete_before_replacement" class="fnname">delete_before_replacement</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object, with the promise to recreate it with the same ID before the next call to
<code>event</code>. This may be called while the object is being hovered on or dragged.</p> <code>event</code>. This may be called while the object is being hovered on or dragged.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.initialize_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#341-346" title="goto source code">[src]</a></div><a href="#method.initialize_hover" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.initialize_hover" class="fnname">initialize_hover</a>(&amp;mut self, ctx: &amp;<a class="struct" href="../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>After adding all objects to a <code>World</code>, call this to initially detect if the cursor is </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.initialize_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#347-352" title="goto source code">[src]</a></div><a href="#method.initialize_hover" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.initialize_hover" class="fnname">initialize_hover</a>(&amp;mut self, ctx: &amp;<a class="struct" href="../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>After adding all objects to a <code>World</code>, call this to initially detect if the cursor is
hovering on an object.</p> hovering on an object.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.rebuilt_during_drag" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#355-361" title="goto source code">[src]</a></div><a href="#method.rebuilt_during_drag" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.rebuilt_during_drag" class="fnname">rebuilt_during_drag</a>(&amp;mut self, prev_world: &amp;<a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;)</h4></div></summary><div class="docblock"><p>If a drag event causes the world to be totally rebuilt, call this with the previous world </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.rebuilt_during_drag" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#361-367" title="goto source code">[src]</a></div><a href="#method.rebuilt_during_drag" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.rebuilt_during_drag" class="fnname">rebuilt_during_drag</a>(&amp;mut self, prev_world: &amp;<a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;)</h4></div></summary><div class="docblock"><p>If a drag event causes the world to be totally rebuilt, call this with the previous world
to preserve the ongoing drag.</p> to preserve the ongoing drag.</p>
<p>This should be called after <code>initialize_hover</code>.</p> <p>This should be called after <code>initialize_hover</code>.</p>
<p>Important: the rebuilt world must include the same object ID thats currently being dragged <p>Important: the rebuilt world must include the same object ID thats currently being dragged
from the previous world.</p> from the previous world.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_master_batch" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#365-367" title="goto source code">[src]</a></div><a href="#method.draw_master_batch" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw_master_batch" class="fnname">draw_master_batch</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="struct.ToggleZoomedBuilder.html" title="struct widgetry::mapspace::ToggleZoomedBuilder">ToggleZoomedBuilder</a>&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;<a class="struct" href="../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;draw: I<br>)</h4></div></summary><div class="docblock"><p>Draw something underneath all objects. This is useful for performance, when a large number </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_master_batch" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#371-373" title="goto source code">[src]</a></div><a href="#method.draw_master_batch" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw_master_batch" class="fnname">draw_master_batch</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="struct.ToggleZoomedBuilder.html" title="struct widgetry::mapspace::ToggleZoomedBuilder">ToggleZoomedBuilder</a>&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;<a class="struct" href="../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;draw: I<br>)</h4></div></summary><div class="docblock"><p>Draw something underneath all objects. This is useful for performance, when a large number
of objects never change appearance.</p> of objects never change appearance.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#370-457" title="goto source code">[src]</a></div><a href="#method.event" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.event" class="fnname">event</a>(&amp;mut self, ctx: &amp;mut <a class="struct" href="../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="enum" href="world/enum.WorldOutcome.html" title="enum widgetry::mapspace::world::WorldOutcome">WorldOutcome</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Let objects in the world respond to something happening.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#376-463" title="goto source code">[src]</a></div><a href="#method.event" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.event" class="fnname">event</a>(&amp;mut self, ctx: &amp;mut <a class="struct" href="../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="enum" href="world/enum.WorldOutcome.html" title="enum widgetry::mapspace::world::WorldOutcome">WorldOutcome</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Let objects in the world respond to something happening.</p>
</div></details><div id="method.calculate_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#459-480" title="goto source code">[src]</a></div><a href="#method.calculate_hover" class="anchor"></a><h4 class="code-header">fn <a href="#method.calculate_hover" class="fnname">calculate_hover</a>(&amp;self, cursor: <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#483-511" title="goto source code">[src]</a></div><a href="#method.draw" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw" class="fnname">draw</a>(&amp;self, g: &amp;mut <a class="struct" href="../drawing/struct.GfxCtx.html" title="struct widgetry::drawing::GfxCtx">GfxCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>Draw objects in the world thatre currently visible.</p> </div></details><div id="method.calculate_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#465-486" title="goto source code">[src]</a></div><a href="#method.calculate_hover" class="anchor"></a><h4 class="code-header">fn <a href="#method.calculate_hover" class="fnname">calculate_hover</a>(&amp;self, cursor: <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#489-517" title="goto source code">[src]</a></div><a href="#method.draw" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw" class="fnname">draw</a>(&amp;self, g: &amp;mut <a class="struct" href="../drawing/struct.GfxCtx.html" title="struct widgetry::drawing::GfxCtx">GfxCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>Draw objects in the world thatre currently visible.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#519-529" title="goto source code">[src]</a></div><a href="#impl-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;<a class="struct" href="world/struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add_unnamed" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#526-528" title="goto source code">[src]</a></div><a href="#method.add_unnamed" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add_unnamed" class="fnname">add_unnamed</a>(&amp;mut self) -&gt; <a class="struct" href="world/struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, <a class="struct" href="world/struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h4></div></summary><div class="docblock"><p>Begin adding an unnamed object to the <code>World</code>.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#525-535" title="goto source code">[src]</a></div><a href="#impl-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="world/struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;<a class="struct" href="world/struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add_unnamed" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#532-534" title="goto source code">[src]</a></div><a href="#method.add_unnamed" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add_unnamed" class="fnname">add_unnamed</a>(&amp;mut self) -&gt; <a class="struct" href="world/struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, <a class="struct" href="world/struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h4></div></summary><div class="docblock"><p>Begin adding an unnamed object to the <code>World</code>.</p>
<p>Note: You must call <code>build</code> on this object before calling <code>add_unnamed</code> again. Otherwise, <p>Note: You must call <code>build</code> on this object before calling <code>add_unnamed</code> again. Otherwise,
the object IDs will collide.</p> the object IDs will collide.</p>
<p>TODO This will break when objects are deleted!</p> <p>TODO This will break when objects are deleted!</p>

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="Objects in a `World` are uniquely identified by this caller-specified type"><meta name="keywords" content="rust, rustlang, rust-lang, ObjectID"><title>ObjectID in widgetry::mapspace - 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 trait"><!--[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='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait ObjectID</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="../index.html">widgetry</a>::<wbr><a href="index.html">mapspace</a></h2><div id="sidebar-vars" data-name="ObjectID" data-ty="trait" 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">Trait <a href="../index.html">widgetry</a>::<wbr><a href="index.html">mapspace</a>::<wbr><a class="trait" href="#">ObjectID</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/widgetry/mapspace/world.rs.html#79" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait"><code>pub trait ObjectID: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Objects in a <code>World</code> are uniquely identified by this caller-specified type</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="Objects in a `World` are uniquely identified by this caller-specified type"><meta name="keywords" content="rust, rustlang, rust-lang, ObjectID"><title>ObjectID in widgetry::mapspace - 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 trait"><!--[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='../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait ObjectID</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="../index.html">widgetry</a>::<wbr><a href="index.html">mapspace</a></h2><div id="sidebar-vars" data-name="ObjectID" data-ty="trait" 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">Trait <a href="../index.html">widgetry</a>::<wbr><a href="index.html">mapspace</a>::<wbr><a class="trait" href="#">ObjectID</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/widgetry/mapspace/world.rs.html#79" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait"><code>pub trait ObjectID: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Objects in a <code>World</code> are uniquely identified by this caller-specified type</p>
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-ObjectID" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#517" title="goto source code">[src]</a></div><a href="#impl-ObjectID" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="world/trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a> for <a class="struct" href="world/struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a></h3></div></div><script type="text/javascript" src="../../implementors/widgetry/mapspace/trait.ObjectID.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="widgetry" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div> </div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-ObjectID" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/widgetry/mapspace/world.rs.html#523" title="goto source code">[src]</a></div><a href="#impl-ObjectID" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="world/trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a> for <a class="struct" href="world/struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a></h3></div></div><script type="text/javascript" src="../../implementors/widgetry/mapspace/trait.ObjectID.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="widgetry" 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 `world` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, world"><title>widgetry::mapspace::world - 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='../../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module world</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="world" 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">widgetry</a>::<wbr><a href="../index.html">mapspace</a>::<wbr><a class="mod" href="#">world</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/widgetry/mapspace/world.rs.html#1-529" 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 `world` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, world"><title>widgetry::mapspace::world - 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='../../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module world</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="world" 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">widgetry</a>::<wbr><a href="../index.html">mapspace</a>::<wbr><a class="mod" href="#">world</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/widgetry/mapspace/world.rs.html#1-535" 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.DummyID.html" title="widgetry::mapspace::world::DummyID struct">DummyID</a></div><div class="item-right docblock-short"><p>If you dont ever need to refer to objects in a <code>World</code>, you can auto-assign dummy IDs.</p> <div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.DummyID.html" title="widgetry::mapspace::world::DummyID struct">DummyID</a></div><div class="item-right docblock-short"><p>If you dont ever need to refer to objects in a <code>World</code>, you can auto-assign dummy IDs.</p>
</div><div class="item-left module-item"><a class="struct" href="struct.Object.html" title="widgetry::mapspace::world::Object struct">Object</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.ObjectBuilder.html" title="widgetry::mapspace::world::ObjectBuilder struct">ObjectBuilder</a></div><div class="item-right docblock-short"><p>This provides a builder API for adding objects to a <code>World</code>.</p> </div><div class="item-left module-item"><a class="struct" href="struct.Object.html" title="widgetry::mapspace::world::Object struct">Object</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.ObjectBuilder.html" title="widgetry::mapspace::world::ObjectBuilder struct">ObjectBuilder</a></div><div class="item-right docblock-short"><p>This provides a builder API for adding objects to a <code>World</code>.</p>
</div><div class="item-left module-item"><a class="struct" href="struct.World.html" title="widgetry::mapspace::world::World struct">World</a></div><div class="item-right docblock-short"><p>A <code>World</code> manages objects that exist in “map-space”, the zoomable and pannable canvas. These </div><div class="item-left module-item"><a class="struct" href="struct.World.html" title="widgetry::mapspace::world::World struct">World</a></div><div class="item-right docblock-short"><p>A <code>World</code> manages objects that exist in “map-space”, the zoomable and pannable canvas. These

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

@ -6,26 +6,26 @@
dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;, dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;,
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <code>World</code> manages objects that exist in “map-space”, the zoomable and pannable canvas. These }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <code>World</code> manages objects that exist in “map-space”, the zoomable and pannable canvas. These
objects can be drawn, hovered on, clicked, dragged, etc.</p> objects can be drawn, hovered on, clicked, dragged, etc.</p>
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.objects" class="structfield small-section-header"><a href="#structfield.objects" class="anchor field"></a><code>objects: <a class="struct" href="https://doc.rust-lang.org/1.56.1/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a>&lt;ID, <a class="struct" href="struct.Object.html" title="struct widgetry::mapspace::world::Object">Object</a>&lt;ID&gt;&gt;</code></span><span id="structfield.quadtree" class="structfield small-section-header"><a href="#structfield.quadtree" class="anchor field"></a><code>quadtree: QuadTree&lt;ID&gt;</code></span><span id="structfield.draw_master_batches" class="structfield small-section-header"><a href="#structfield.draw_master_batches" class="anchor field"></a><code>draw_master_batches: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../struct.ToggleZoomed.html" title="struct widgetry::mapspace::ToggleZoomed">ToggleZoomed</a>&gt;</code></span><span id="structfield.hovering" class="structfield small-section-header"><a href="#structfield.hovering" class="anchor field"></a><code>hovering: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</code></span><span id="structfield.dragging_from" class="structfield small-section-header"><a href="#structfield.dragging_from" class="anchor field"></a><code>dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;</code></span><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/widgetry/mapspace/world.rs.html#263-512" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;ID:&nbsp;<a class="trait" href="trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a>&gt; <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unbounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#265-278" title="goto source code">[src]</a></div><a href="#method.unbounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.unbounded" class="fnname">unbounded</a>() -&gt; <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist anywhere from (0, 0) to the max f64.</p> </div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.objects" class="structfield small-section-header"><a href="#structfield.objects" class="anchor field"></a><code>objects: <a class="struct" href="https://doc.rust-lang.org/1.56.1/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a>&lt;ID, <a class="struct" href="struct.Object.html" title="struct widgetry::mapspace::world::Object">Object</a>&lt;ID&gt;&gt;</code></span><span id="structfield.quadtree" class="structfield small-section-header"><a href="#structfield.quadtree" class="anchor field"></a><code>quadtree: QuadTree&lt;ID&gt;</code></span><span id="structfield.draw_master_batches" class="structfield small-section-header"><a href="#structfield.draw_master_batches" class="anchor field"></a><code>draw_master_batches: <a class="struct" href="https://doc.rust-lang.org/1.56.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../struct.ToggleZoomed.html" title="struct widgetry::mapspace::ToggleZoomed">ToggleZoomed</a>&gt;</code></span><span id="structfield.hovering" class="structfield small-section-header"><a href="#structfield.hovering" class="anchor field"></a><code>hovering: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</code></span><span id="structfield.dragging_from" class="structfield small-section-header"><a href="#structfield.dragging_from" class="anchor field"></a><code>dragging_from: <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">(</a><a class="struct" href="../../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>, <a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/1.56.1/std/primitive.tuple.html">)</a>&gt;</code></span><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/widgetry/mapspace/world.rs.html#269-518" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;ID:&nbsp;<a class="trait" href="trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a>&gt; <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unbounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#271-284" title="goto source code">[src]</a></div><a href="#method.unbounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.unbounded" class="fnname">unbounded</a>() -&gt; <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist anywhere from (0, 0) to the max f64.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.bounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#281-291" title="goto source code">[src]</a></div><a href="#method.bounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.bounded" class="fnname">bounded</a>(bounds: &amp;<a class="struct" href="../../../geom/bounds/struct.Bounds.html" title="struct geom::bounds::Bounds">Bounds</a>) -&gt; <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist in the provided rectangular boundary.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.bounded" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#287-297" title="goto source code">[src]</a></div><a href="#method.bounded" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.bounded" class="fnname">bounded</a>(bounds: &amp;<a class="struct" href="../../../geom/bounds/struct.Bounds.html" title="struct geom::bounds::Bounds">Bounds</a>) -&gt; <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Creates an empty <code>World</code>, whose objects can exist in the provided rectangular boundary.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#295-310" title="goto source code">[src]</a></div><a href="#method.add" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add" class="fnname">add</a>(&amp;mut self, id: ID) -&gt; <a class="struct" href="struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, ID&gt;</h4></div></summary><div class="docblock"><p>Start adding an object to the <code>World</code>. The caller should specify the object with methods on </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#301-316" title="goto source code">[src]</a></div><a href="#method.add" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add" class="fnname">add</a>(&amp;mut self, id: ID) -&gt; <a class="struct" href="struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, ID&gt;</h4></div></summary><div class="docblock"><p>Start adding an object to the <code>World</code>. The caller should specify the object with methods on
<code>ObjectBuilder</code>, then call <code>build</code>.</p> <code>ObjectBuilder</code>, then call <code>build</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#314-323" title="goto source code">[src]</a></div><a href="#method.delete" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete" class="fnname">delete</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object. Not idempotent this will panic if the object doesnt exist. Will panic </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#320-329" title="goto source code">[src]</a></div><a href="#method.delete" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete" class="fnname">delete</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object. Not idempotent this will panic if the object doesnt exist. Will panic
if the object is deleted in the middle of being dragged.</p> if the object is deleted in the middle of being dragged.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete_before_replacement" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#327-337" title="goto source code">[src]</a></div><a href="#method.delete_before_replacement" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete_before_replacement" class="fnname">delete_before_replacement</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object, with the promise to recreate it with the same ID before the next call to </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.delete_before_replacement" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#333-343" title="goto source code">[src]</a></div><a href="#method.delete_before_replacement" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.delete_before_replacement" class="fnname">delete_before_replacement</a>(&amp;mut self, id: ID)</h4></div></summary><div class="docblock"><p>Delete an object, with the promise to recreate it with the same ID before the next call to
<code>event</code>. This may be called while the object is being hovered on or dragged.</p> <code>event</code>. This may be called while the object is being hovered on or dragged.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.initialize_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#341-346" title="goto source code">[src]</a></div><a href="#method.initialize_hover" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.initialize_hover" class="fnname">initialize_hover</a>(&amp;mut self, ctx: &amp;<a class="struct" href="../../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>After adding all objects to a <code>World</code>, call this to initially detect if the cursor is </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.initialize_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#347-352" title="goto source code">[src]</a></div><a href="#method.initialize_hover" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.initialize_hover" class="fnname">initialize_hover</a>(&amp;mut self, ctx: &amp;<a class="struct" href="../../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>After adding all objects to a <code>World</code>, call this to initially detect if the cursor is
hovering on an object.</p> hovering on an object.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.rebuilt_during_drag" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#355-361" title="goto source code">[src]</a></div><a href="#method.rebuilt_during_drag" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.rebuilt_during_drag" class="fnname">rebuilt_during_drag</a>(&amp;mut self, prev_world: &amp;<a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;)</h4></div></summary><div class="docblock"><p>If a drag event causes the world to be totally rebuilt, call this with the previous world </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.rebuilt_during_drag" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#361-367" title="goto source code">[src]</a></div><a href="#method.rebuilt_during_drag" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.rebuilt_during_drag" class="fnname">rebuilt_during_drag</a>(&amp;mut self, prev_world: &amp;<a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;ID&gt;)</h4></div></summary><div class="docblock"><p>If a drag event causes the world to be totally rebuilt, call this with the previous world
to preserve the ongoing drag.</p> to preserve the ongoing drag.</p>
<p>This should be called after <code>initialize_hover</code>.</p> <p>This should be called after <code>initialize_hover</code>.</p>
<p>Important: the rebuilt world must include the same object ID thats currently being dragged <p>Important: the rebuilt world must include the same object ID thats currently being dragged
from the previous world.</p> from the previous world.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_master_batch" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#365-367" title="goto source code">[src]</a></div><a href="#method.draw_master_batch" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw_master_batch" class="fnname">draw_master_batch</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="../struct.ToggleZoomedBuilder.html" title="struct widgetry::mapspace::ToggleZoomedBuilder">ToggleZoomedBuilder</a>&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;<a class="struct" href="../../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;draw: I<br>)</h4></div></summary><div class="docblock"><p>Draw something underneath all objects. This is useful for performance, when a large number </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_master_batch" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#371-373" title="goto source code">[src]</a></div><a href="#method.draw_master_batch" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw_master_batch" class="fnname">draw_master_batch</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.56.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="../struct.ToggleZoomedBuilder.html" title="struct widgetry::mapspace::ToggleZoomedBuilder">ToggleZoomedBuilder</a>&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;<a class="struct" href="../../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;draw: I<br>)</h4></div></summary><div class="docblock"><p>Draw something underneath all objects. This is useful for performance, when a large number
of objects never change appearance.</p> of objects never change appearance.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#370-457" title="goto source code">[src]</a></div><a href="#method.event" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.event" class="fnname">event</a>(&amp;mut self, ctx: &amp;mut <a class="struct" href="../../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="enum" href="enum.WorldOutcome.html" title="enum widgetry::mapspace::world::WorldOutcome">WorldOutcome</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Let objects in the world respond to something happening.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#376-463" title="goto source code">[src]</a></div><a href="#method.event" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.event" class="fnname">event</a>(&amp;mut self, ctx: &amp;mut <a class="struct" href="../../event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a>&lt;'_&gt;) -&gt; <a class="enum" href="enum.WorldOutcome.html" title="enum widgetry::mapspace::world::WorldOutcome">WorldOutcome</a>&lt;ID&gt;</h4></div></summary><div class="docblock"><p>Let objects in the world respond to something happening.</p>
</div></details><div id="method.calculate_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#459-480" title="goto source code">[src]</a></div><a href="#method.calculate_hover" class="anchor"></a><h4 class="code-header">fn <a href="#method.calculate_hover" class="fnname">calculate_hover</a>(&amp;self, cursor: <a class="struct" href="../../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#483-511" title="goto source code">[src]</a></div><a href="#method.draw" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw" class="fnname">draw</a>(&amp;self, g: &amp;mut <a class="struct" href="../../drawing/struct.GfxCtx.html" title="struct widgetry::drawing::GfxCtx">GfxCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>Draw objects in the world thatre currently visible.</p> </div></details><div id="method.calculate_hover" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#465-486" title="goto source code">[src]</a></div><a href="#method.calculate_hover" class="anchor"></a><h4 class="code-header">fn <a href="#method.calculate_hover" class="fnname">calculate_hover</a>(&amp;self, cursor: <a class="struct" href="../../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.56.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;ID&gt;</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#489-517" title="goto source code">[src]</a></div><a href="#method.draw" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.draw" class="fnname">draw</a>(&amp;self, g: &amp;mut <a class="struct" href="../../drawing/struct.GfxCtx.html" title="struct widgetry::drawing::GfxCtx">GfxCtx</a>&lt;'_&gt;)</h4></div></summary><div class="docblock"><p>Draw objects in the world thatre currently visible.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#519-529" title="goto source code">[src]</a></div><a href="#impl-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;<a class="struct" href="struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add_unnamed" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#526-528" title="goto source code">[src]</a></div><a href="#method.add_unnamed" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add_unnamed" class="fnname">add_unnamed</a>(&amp;mut self) -&gt; <a class="struct" href="struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, <a class="struct" href="struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h4></div></summary><div class="docblock"><p>Begin adding an unnamed object to the <code>World</code>.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#525-535" title="goto source code">[src]</a></div><a href="#impl-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.World.html" title="struct widgetry::mapspace::world::World">World</a>&lt;<a class="struct" href="struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.add_unnamed" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#532-534" title="goto source code">[src]</a></div><a href="#method.add_unnamed" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add_unnamed" class="fnname">add_unnamed</a>(&amp;mut self) -&gt; <a class="struct" href="struct.ObjectBuilder.html" title="struct widgetry::mapspace::world::ObjectBuilder">ObjectBuilder</a>&lt;'_, <a class="struct" href="struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a>&gt;</h4></div></summary><div class="docblock"><p>Begin adding an unnamed object to the <code>World</code>.</p>
<p>Note: You must call <code>build</code> on this object before calling <code>add_unnamed</code> again. Otherwise, <p>Note: You must call <code>build</code> on this object before calling <code>add_unnamed</code> again. Otherwise,
the object IDs will collide.</p> the object IDs will collide.</p>
<p>TODO This will break when objects are deleted!</p> <p>TODO This will break when objects are deleted!</p>

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="Objects in a `World` are uniquely identified by this caller-specified type"><meta name="keywords" content="rust, rustlang, rust-lang, ObjectID"><title>ObjectID in widgetry::mapspace::world - 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 trait"><!--[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='../../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait ObjectID</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">mapspace</a>::<wbr><a href="index.html">world</a></h2><div id="sidebar-vars" data-name="ObjectID" data-ty="trait" 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">Trait <a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">mapspace</a>::<wbr><a href="index.html">world</a>::<wbr><a class="trait" href="#">ObjectID</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/widgetry/mapspace/world.rs.html#79" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait"><code>pub trait ObjectID: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Objects in a <code>World</code> are uniquely identified by this caller-specified type</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="Objects in a `World` are uniquely identified by this caller-specified type"><meta name="keywords" content="rust, rustlang, rust-lang, ObjectID"><title>ObjectID in widgetry::mapspace::world - 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 trait"><!--[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='../../../widgetry/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait ObjectID</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">mapspace</a>::<wbr><a href="index.html">world</a></h2><div id="sidebar-vars" data-name="ObjectID" data-ty="trait" 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">Trait <a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">mapspace</a>::<wbr><a href="index.html">world</a>::<wbr><a class="trait" href="#">ObjectID</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/widgetry/mapspace/world.rs.html#79" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait"><code>pub trait ObjectID: <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.56.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Objects in a <code>World</code> are uniquely identified by this caller-specified type</p>
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-ObjectID" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#517" title="goto source code">[src]</a></div><a href="#impl-ObjectID" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a> for <a class="struct" href="struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a></h3></div></div><script type="text/javascript" src="../../../implementors/widgetry/mapspace/world/trait.ObjectID.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="widgetry" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div> </div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-ObjectID" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/widgetry/mapspace/world.rs.html#523" title="goto source code">[src]</a></div><a href="#impl-ObjectID" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.ObjectID.html" title="trait widgetry::mapspace::world::ObjectID">ObjectID</a> for <a class="struct" href="struct.DummyID.html" title="struct widgetry::mapspace::world::DummyID">DummyID</a></h3></div></div><script type="text/javascript" src="../../../implementors/widgetry/mapspace/world/trait.ObjectID.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="widgetry" 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>