mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
deploy: a68af804e3
This commit is contained in:
parent
216a69c3eb
commit
5b233fd29b
@ -257,8 +257,8 @@ call this to handle all other events. <a href="#method.other_event">Read more</a
|
||||
</div><h4 id="method.draw-44" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/sandbox/dashboards/trip_table.rs.html#173-176" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div><h4 id="method.draw_baselayer-43" class="method hidden"><code>pub fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.on_destroy-43" class="method hidden"><code>pub fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></div><h3 id="impl-State%3CApp%3E-44" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-State%3CApp%3E-44" class="anchor"></a><a class="srclink" href="../../src/game/sandbox/gameplay/freeform.rs.html#360-546" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event-44" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/sandbox/gameplay/freeform.rs.html#361-516" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw-45" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/sandbox/gameplay/freeform.rs.html#518-545" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div></div><h3 id="impl-State%3CApp%3E-44" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-State%3CApp%3E-44" class="anchor"></a><a class="srclink" href="../../src/game/sandbox/gameplay/freeform.rs.html#362-553" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event-44" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/sandbox/gameplay/freeform.rs.html#363-523" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw-45" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/sandbox/gameplay/freeform.rs.html#525-552" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div><h4 id="method.draw_baselayer-44" class="method hidden"><code>pub fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.on_destroy-44" class="method hidden"><code>pub fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></div><h3 id="impl-State%3CApp%3E-45" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/sandbox/gameplay/play_scenario/struct.EditScenarioModifiers.html" title="struct game::sandbox::gameplay::play_scenario::EditScenarioModifiers">EditScenarioModifiers</a></code><a href="#impl-State%3CApp%3E-45" class="anchor"></a><a class="srclink" href="../../src/game/sandbox/gameplay/play_scenario.rs.html#292-384" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event-45" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/sandbox/gameplay/play_scenario.rs.html#293-378" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-a95c4551e63dceca/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Sat, 20 Mar 2021 00:56:35 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-a95c4551e63dceca/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Sat, 20 Mar 2021 02:33:20 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -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 `actions` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, actions"><title>game::sandbox::gameplay::freeform::actions - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a></p><script>window.sidebarCurrent = {name: "actions", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#616-622" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="fn" href="">actions</a></span></h1><pre class="rust fn">pub fn actions(_: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>, id: <a class="enum" href="../../../../map_gui/enum.ID.html" title="enum map_gui::ID">ID</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Key, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#623-629" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="fn" href="">actions</a></span></h1><pre class="rust fn">pub fn actions(_: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>, id: <a class="enum" href="../../../../map_gui/enum.ID.html" title="enum map_gui::ID">ID</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Key, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
@ -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 `execute` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, execute"><title>game::sandbox::gameplay::freeform::execute - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a></p><script>window.sidebarCurrent = {name: "execute", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#624-633" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="fn" href="">execute</a></span></h1><pre class="rust fn">pub fn execute(<br> ctx: &mut EventCtx<'_>, <br> app: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> id: <a class="enum" href="../../../../map_gui/enum.ID.html" title="enum map_gui::ID">ID</a>, <br> action: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> Transition<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#631-640" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="fn" href="">execute</a></span></h1><pre class="rust fn">pub fn execute(<br> ctx: &mut EventCtx<'_>, <br> app: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> id: <a class="enum" href="../../../../map_gui/enum.ID.html" title="enum map_gui::ID">ID</a>, <br> action: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -> Transition<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
@ -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 `spawn_agents_around` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, spawn_agents_around"><title>game::sandbox::gameplay::freeform::spawn_agents_around - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a></p><script>window.sidebarCurrent = {name: "spawn_agents_around", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#548-614" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="fn" href="">spawn_agents_around</a></span></h1><pre class="rust fn">pub fn spawn_agents_around(i: <a class="struct" href="../../../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>, app: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>)</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#555-621" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="fn" href="">spawn_agents_around</a></span></h1><pre class="rust fn">pub fn spawn_agents_around(i: <a class="struct" href="../../../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>, app: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>)</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
@ -1,6 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `freeform` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, freeform"><title>game::sandbox::gameplay::freeform - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><p class="location">Module freeform</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a></p><script>window.sidebarCurrent = {name: "freeform", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#1-633" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a class="mod" href="">freeform</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#1-640" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a class="mod" href="">freeform</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.AgentSpawner.html" title="game::sandbox::gameplay::freeform::AgentSpawner struct">AgentSpawner</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.ChangeScenario.html" title="game::sandbox::gameplay::freeform::ChangeScenario struct">ChangeScenario</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Freeform.html" title="game::sandbox::gameplay::freeform::Freeform struct">Freeform</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.actions.html" title="game::sandbox::gameplay::freeform::actions fn">actions</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.execute.html" title="game::sandbox::gameplay::freeform::execute fn">execute</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.spawn_agents_around.html" title="game::sandbox::gameplay::freeform::spawn_agents_around fn">spawn_agents_around</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
@ -1,14 +1,14 @@
|
||||
<!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 `AgentSpawner` struct in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, AgentSpawner"><title>game::sandbox::gameplay::freeform::AgentSpawner - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct AgentSpawner</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.confirmed">confirmed</a><a href="#structfield.goal">goal</a><a href="#structfield.panel">panel</a><a href="#structfield.source">source</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-State%3CApp%3E">State<App></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a></p><script>window.sidebarCurrent = {name: "AgentSpawner", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#302-307" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="struct" href="">AgentSpawner</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct AgentSpawner {
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#302-309" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">freeform</a>::<wbr><a class="struct" href="">AgentSpawner</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct AgentSpawner {
|
||||
panel: Panel,
|
||||
source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../../../sim/make/spawner/enum.TripEndpoint.html" title="enum sim::make::spawner::TripEndpoint">TripEndpoint</a>>,
|
||||
goal: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../../sim/make/spawner/enum.TripEndpoint.html" title="enum sim::make::spawner::TripEndpoint">TripEndpoint</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,
|
||||
goal: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../../sim/make/spawner/enum.TripEndpoint.html" title="enum sim::make::spawner::TripEndpoint">TripEndpoint</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,
|
||||
confirmed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
|
||||
}</pre></div><h2 id="fields" class="fields small-section-header">
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><span id="structfield.source" class="structfield small-section-header"><a href="#structfield.source" class="anchor field"></a><code>source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../../../sim/make/spawner/enum.TripEndpoint.html" title="enum sim::make::spawner::TripEndpoint">TripEndpoint</a>></code></span><span id="structfield.goal" class="structfield small-section-header"><a href="#structfield.goal" class="anchor field"></a><code>goal: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../../sim/make/spawner/enum.TripEndpoint.html" title="enum sim::make::spawner::TripEndpoint">TripEndpoint</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code></span><span id="structfield.confirmed" class="structfield small-section-header"><a href="#structfield.confirmed" class="anchor field"></a><code>confirmed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#309-358" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(ctx: &mut EventCtx<'_>, start: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>>></code><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#310-357" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-State%3CApp%3E" class="impl"><code class="in-band">impl State<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-State%3CApp%3E" class="anchor"></a><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#360-546" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#361-516" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#518-545" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><span id="structfield.source" class="structfield small-section-header"><a href="#structfield.source" class="anchor field"></a><code>source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../../../sim/make/spawner/enum.TripEndpoint.html" title="enum sim::make::spawner::TripEndpoint">TripEndpoint</a>></code></span><span id="structfield.goal" class="structfield small-section-header"><a href="#structfield.goal" class="anchor field"></a><code>goal: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="../../../../sim/make/spawner/enum.TripEndpoint.html" title="enum sim::make::spawner::TripEndpoint">TripEndpoint</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code></span><span id="structfield.confirmed" class="structfield small-section-header"><a href="#structfield.confirmed" class="anchor field"></a><code>confirmed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#311-360" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(ctx: &mut EventCtx<'_>, start: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>>></code><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#312-359" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-State%3CApp%3E" class="impl"><code class="in-band">impl State<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-State%3CApp%3E" class="anchor"></a><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#362-553" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#363-523" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../../../src/game/sandbox/gameplay/freeform.rs.html#525-552" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div><h4 id="method.draw_baselayer" class="method hidden"><code>pub fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.on_destroy" class="method hidden"><code>pub fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../../game/sandbox/gameplay/freeform/struct.AgentSpawner.html" title="struct game::sandbox::gameplay::freeform::AgentSpawner">AgentSpawner</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../../src/game/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `pathfinder` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, pathfinder"><title>map_model::pathfind::pathfinder - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module pathfinder</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li></ul></div><p class="location"><a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a></p><script>window.sidebarCurrent = {name: "pathfinder", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/pathfind/pathfinder.rs.html#1-337" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a>::<wbr><a class="mod" href="">pathfinder</a></span></h1><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/pathfind/pathfinder.rs.html#1-339" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">pathfind</a>::<wbr><a class="mod" href="">pathfinder</a></span></h1><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
|
||||
<table><tr class="module-item"><td><a class="enum" href="enum.Pathfinder.html" title="map_model::pathfind::pathfinder::Pathfinder enum">Pathfinder</a></td><td class="docblock-short"><p>Most of the time, prefer using the faster contraction hierarchies. But sometimes, callers can
|
||||
explicitly opt into a slower (but preparation-free) pathfinder that just uses Dijkstra's
|
||||
maneuever.</p>
|
||||
|
File diff suppressed because one or more lines are too long
@ -122,7 +122,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.50.0 (cb75ad5db 2021-02-10)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Sat, 20 Mar 2021 00:56:35 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Sat, 20 Mar 2021 02:33:20 +0000"</span>;
|
||||
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"x86_64"</span>;
|
||||
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>
|
||||
|
@ -634,6 +634,13 @@
|
||||
<span id="631">631</span>
|
||||
<span id="632">632</span>
|
||||
<span id="633">633</span>
|
||||
<span id="634">634</span>
|
||||
<span id="635">635</span>
|
||||
<span id="636">636</span>
|
||||
<span id="637">637</span>
|
||||
<span id="638">638</span>
|
||||
<span id="639">639</span>
|
||||
<span id="640">640</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">seq</span>::<span class="ident">SliceRandom</span>;
|
||||
<span class="kw">use</span> <span class="ident">rand</span>::<span class="ident">Rng</span>;
|
||||
@ -939,7 +946,9 @@
|
||||
<span class="kw">struct</span> <span class="ident">AgentSpawner</span> {
|
||||
<span class="ident">panel</span>: <span class="ident">Panel</span>,
|
||||
<span class="ident">source</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">TripEndpoint</span><span class="op">></span>,
|
||||
<span class="ident">goal</span>: <span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">TripEndpoint</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Polygon</span><span class="op">></span>)<span class="op">></span>,
|
||||
<span class="comment">// (goal, feasible path, draw the path). Even if we can't draw the path, remember if the path</span>
|
||||
<span class="comment">// exists at all.</span>
|
||||
<span class="ident">goal</span>: <span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">TripEndpoint</span>, <span class="ident">bool</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Polygon</span><span class="op">></span>)<span class="op">></span>,
|
||||
<span class="ident">confirmed</span>: <span class="ident">bool</span>,
|
||||
}
|
||||
|
||||
@ -1046,6 +1055,7 @@
|
||||
{
|
||||
<span class="self">self</span>.<span class="ident">goal</span> <span class="op">=</span> <span class="prelude-val">Some</span>((
|
||||
<span class="ident">to</span>,
|
||||
<span class="bool-val">true</span>,
|
||||
<span class="ident">path</span>.<span class="ident">trace</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>)
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">pl</span><span class="op">|</span> <span class="ident">pl</span>.<span class="ident">make_polygons</span>(<span class="ident">NORMAL_LANE_THICKNESS</span>)),
|
||||
));
|
||||
@ -1105,7 +1115,7 @@
|
||||
<span class="kw">if</span> <span class="self">self</span>
|
||||
.<span class="ident">goal</span>
|
||||
.<span class="ident">as_ref</span>()
|
||||
.<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">to</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">to</span> <span class="op">!</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">hovering</span>)
|
||||
.<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">to</span>, <span class="kw">_</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">to</span> <span class="op">!</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">hovering</span>)
|
||||
.<span class="ident">unwrap_or</span>(<span class="bool-val">true</span>)
|
||||
{
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="op">=</span> <span class="ident">TripEndpoint</span>::<span class="ident">path_req</span>(
|
||||
@ -1118,15 +1128,19 @@
|
||||
{
|
||||
<span class="self">self</span>.<span class="ident">goal</span> <span class="op">=</span> <span class="prelude-val">Some</span>((
|
||||
<span class="ident">hovering</span>,
|
||||
<span class="bool-val">true</span>,
|
||||
<span class="ident">path</span>.<span class="ident">trace</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>)
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">pl</span><span class="op">|</span> <span class="ident">pl</span>.<span class="ident">make_polygons</span>(<span class="ident">NORMAL_LANE_THICKNESS</span>)),
|
||||
));
|
||||
} <span class="kw">else</span> {
|
||||
<span class="self">self</span>.<span class="ident">goal</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||
<span class="comment">// Don't constantly recalculate a failed path</span>
|
||||
<span class="self">self</span>.<span class="ident">goal</span> <span class="op">=</span> <span class="prelude-val">Some</span>((<span class="ident">hovering</span>, <span class="bool-val">false</span>, <span class="prelude-val">None</span>));
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">goal</span>.<span class="ident">is_some</span>() <span class="op">&&</span> <span class="ident">app</span>.<span class="ident">per_obj</span>.<span class="ident">left_click</span>(<span class="ident">ctx</span>, <span class="string">"end here"</span>) {
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">goal</span>.<span class="ident">as_ref</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">ok</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="kw-2">*</span><span class="ident">ok</span>).<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>)
|
||||
<span class="op">&&</span> <span class="ident">app</span>.<span class="ident">per_obj</span>.<span class="ident">left_click</span>(<span class="ident">ctx</span>, <span class="string">"end here"</span>)
|
||||
{
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">current_selection</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||
<span class="self">self</span>.<span class="ident">confirmed</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
<span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">replace</span>(
|
||||
@ -1166,7 +1180,7 @@
|
||||
},
|
||||
);
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="kw-2">ref</span> <span class="ident">endpt</span>, <span class="kw-2">ref</span> <span class="ident">poly</span>)) <span class="op">=</span> <span class="self">self</span>.<span class="ident">goal</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="kw-2">ref</span> <span class="ident">endpt</span>, <span class="kw">_</span>, <span class="kw-2">ref</span> <span class="ident">poly</span>)) <span class="op">=</span> <span class="self">self</span>.<span class="ident">goal</span> {
|
||||
<span class="ident">g</span>.<span class="ident">draw_polygon</span>(
|
||||
<span class="ident">Color</span>::<span class="ident">GREEN</span>.<span class="ident">alpha</span>(<span class="number">0.8</span>),
|
||||
<span class="kw">match</span> <span class="ident">endpt</span> {
|
||||
|
@ -338,6 +338,8 @@
|
||||
<span id="335">335</span>
|
||||
<span id="336">336</span>
|
||||
<span id="337">337</span>
|
||||
<span id="338">338</span>
|
||||
<span id="339">339</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;
|
||||
|
||||
@ -412,18 +414,18 @@
|
||||
.<span class="ident">allow_through_traffic</span>
|
||||
.<span class="ident">contains</span>(<span class="ident">req</span>.<span class="ident">constraints</span>)
|
||||
{
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">borders</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Intersection</span><span class="op">></span> <span class="op">=</span>
|
||||
<span class="ident">zone</span>.<span class="ident">borders</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>)).<span class="ident">collect</span>();
|
||||
<span class="comment">// TODO Use the CH to pick the lowest overall cost?</span>
|
||||
<span class="kw">let</span> <span class="ident">pt</span> <span class="op">=</span> <span class="ident">req</span>.<span class="ident">end</span>.<span class="ident">pt</span>(<span class="ident">map</span>);
|
||||
<span class="ident">borders</span>.<span class="ident">sort_by_key</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">pt</span>.<span class="ident">dist_to</span>(<span class="ident">i</span>.<span class="ident">polygon</span>.<span class="ident">center</span>()));
|
||||
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="ident">borders</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">result</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">pathfind_from_zone</span>(<span class="ident">i</span>, <span class="ident">req</span>.<span class="ident">clone</span>(), <span class="ident">zone</span>, <span class="ident">map</span>) {
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">result</span>);
|
||||
<span class="comment">// Calculate the entire path using every possible border, then take the one</span>
|
||||
<span class="comment">// with the least total distance.</span>
|
||||
<span class="comment">// TODO This is slow and doesn't account for the mode-specific cost.</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">paths</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">zone</span>.<span class="ident">borders</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">result</span>) <span class="op">=</span>
|
||||
<span class="self">self</span>.<span class="ident">pathfind_from_zone</span>(<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>), <span class="ident">req</span>.<span class="ident">clone</span>(), <span class="ident">zone</span>, <span class="ident">map</span>)
|
||||
{
|
||||
<span class="ident">paths</span>.<span class="ident">push</span>(<span class="ident">result</span>);
|
||||
}
|
||||
}
|
||||
<span class="kw">return</span> <span class="prelude-val">None</span>;
|
||||
<span class="kw">return</span> <span class="ident">paths</span>.<span class="ident">into_iter</span>().<span class="ident">min_by_key</span>(<span class="op">|</span><span class="ident">p</span><span class="op">|</span> <span class="ident">p</span>.<span class="ident">total_length</span>());
|
||||
}
|
||||
}
|
||||
(<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="ident">zone</span>)) <span class="op">=</span><span class="op">></span> {
|
||||
@ -432,18 +434,18 @@
|
||||
.<span class="ident">allow_through_traffic</span>
|
||||
.<span class="ident">contains</span>(<span class="ident">req</span>.<span class="ident">constraints</span>)
|
||||
{
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">borders</span>: <span class="ident">Vec</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Intersection</span><span class="op">></span> <span class="op">=</span>
|
||||
<span class="ident">zone</span>.<span class="ident">borders</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>)).<span class="ident">collect</span>();
|
||||
<span class="comment">// TODO Use the CH to pick the lowest overall cost?</span>
|
||||
<span class="kw">let</span> <span class="ident">pt</span> <span class="op">=</span> <span class="ident">req</span>.<span class="ident">start</span>.<span class="ident">pt</span>(<span class="ident">map</span>);
|
||||
<span class="ident">borders</span>.<span class="ident">sort_by_key</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">pt</span>.<span class="ident">dist_to</span>(<span class="ident">i</span>.<span class="ident">polygon</span>.<span class="ident">center</span>()));
|
||||
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="ident">borders</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">result</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">pathfind_to_zone</span>(<span class="ident">i</span>, <span class="ident">req</span>.<span class="ident">clone</span>(), <span class="ident">zone</span>, <span class="ident">map</span>) {
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">result</span>);
|
||||
<span class="comment">// Calculate the entire path using every possible border, then take the one</span>
|
||||
<span class="comment">// with the least total distance.</span>
|
||||
<span class="comment">// TODO This is slow and doesn't account for the mode-specific cost.</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">paths</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">zone</span>.<span class="ident">borders</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">result</span>) <span class="op">=</span>
|
||||
<span class="self">self</span>.<span class="ident">pathfind_to_zone</span>(<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>), <span class="ident">req</span>.<span class="ident">clone</span>(), <span class="ident">zone</span>, <span class="ident">map</span>)
|
||||
{
|
||||
<span class="ident">paths</span>.<span class="ident">push</span>(<span class="ident">result</span>);
|
||||
}
|
||||
}
|
||||
<span class="kw">return</span> <span class="prelude-val">None</span>;
|
||||
<span class="kw">return</span> <span class="ident">paths</span>.<span class="ident">into_iter</span>().<span class="ident">min_by_key</span>(<span class="op">|</span><span class="ident">p</span><span class="op">|</span> <span class="ident">p</span>.<span class="ident">total_length</span>());
|
||||
}
|
||||
}
|
||||
(<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) <span class="op">=</span><span class="op">></span> {}
|
||||
@ -566,6 +568,7 @@
|
||||
},
|
||||
<span class="ident">constraints</span>: <span class="ident">req</span>.<span class="ident">constraints</span>,
|
||||
};
|
||||
<span class="kw">let</span> <span class="ident">orig_req</span> <span class="op">=</span> <span class="ident">req</span>.<span class="ident">clone</span>();
|
||||
<span class="ident">req</span>.<span class="ident">start</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">map</span>.<span class="ident">get_l</span>(<span class="ident">dst</span>).<span class="ident">src_i</span> <span class="op">=</span><span class="op">=</span> <span class="ident">i</span>.<span class="ident">id</span> {
|
||||
<span class="ident">Position</span>::<span class="ident">start</span>(<span class="ident">dst</span>)
|
||||
} <span class="kw">else</span> {
|
||||
@ -586,12 +589,13 @@
|
||||
};
|
||||
<span class="ident">interior_path</span>.<span class="ident">extend</span>(<span class="ident">main_path</span>);
|
||||
<span class="kw">let</span> <span class="ident">steps</span> <span class="op">=</span> <span class="ident">walking_path_to_steps</span>(<span class="ident">interior_path</span>, <span class="ident">map</span>);
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="ident">map</span>, <span class="ident">steps</span>, <span class="ident">req</span>, <span class="ident">Vec</span>::<span class="ident">new</span>()));
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="ident">map</span>, <span class="ident">steps</span>, <span class="ident">orig_req</span>, <span class="ident">Vec</span>::<span class="ident">new</span>()));
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">interior_path</span> <span class="op">=</span> <span class="ident">zone</span>.<span class="ident">pathfind</span>(<span class="ident">interior_req</span>, <span class="ident">map</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let</span> <span class="ident">main_path</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">simple_pathfind</span>(<span class="kw-2">&</span><span class="ident">req</span>, <span class="ident">map</span>.<span class="ident">routing_params</span>(), <span class="ident">map</span>)<span class="question-mark">?</span>;
|
||||
<span class="ident">interior_path</span>.<span class="ident">append</span>(<span class="ident">main_path</span>, <span class="ident">map</span>);
|
||||
<span class="ident">interior_path</span>.<span class="ident">orig_req</span> <span class="op">=</span> <span class="ident">orig_req</span>;
|
||||
<span class="prelude-val">Some</span>(<span class="ident">interior_path</span>)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user