This commit is contained in:
dabreegster 2020-12-04 04:54:27 +00:00
parent 86bfe71f7a
commit c32cb1be23
25 changed files with 192 additions and 45 deletions

View File

@ -3,4 +3,4 @@
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../experiment/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate experiment</p><div class='block version'><p>Version 0.1.0</p></div><a id='all-types' href='index.html'><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span>
</span>
<span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='animation/struct.Animator.html'>animation::Animator</a></li><li><a href='animation/struct.Effect.html'>animation::Effect</a></li><li><a href='animation/struct.SnowEffect.html'>animation::SnowEffect</a></li><li><a href='animation/struct.Snowflake.html'>animation::Snowflake</a></li><li><a href='buildings/struct.Buildings.html'>buildings::Buildings</a></li><li><a href='controls/struct.InstantController.html'>controls::InstantController</a></li><li><a href='game/struct.EnergylessArrow.html'>game::EnergylessArrow</a></li><li><a href='game/struct.Game.html'>game::Game</a></li><li><a href='game/struct.GameState.html'>game::GameState</a></li><li><a href='levels/struct.Level.html'>levels::Level</a></li><li><a href='levels/struct.TitleScreen.html'>levels::TitleScreen</a></li><li><a href='movement/struct.BuildingsAlongRoad.html'>movement::BuildingsAlongRoad</a></li><li><a href='movement/struct.Player.html'>movement::Player</a></li><li><a href='upzone/struct.Picker.html'>upzone::Picker</a></li><li><a href='vehicles/struct.Vehicle.html'>vehicles::Vehicle</a></li></ul><h3 id='Enums'>Enums</h3><ul class='enums docblock'><li><a href='buildings/enum.BldgState.html'>buildings::BldgState</a></li><li><a href='movement/enum.On.html'>movement::On</a></li></ul><h3 id='Functions'>Functions</h3><ul class='functions docblock'><li><a href='levels/fn.all_levels.html'>levels::all_levels</a></li><li><a href='fn.main.html'>main</a></li><li><a href='meters/fn.make_bar.html'>meters::make_bar</a></li></ul><h3 id='Constants'>Constants</h3><ul class='constants docblock'><li><a href='controls/constant.HACK.html'>controls::HACK</a></li><li><a href='movement/constant.ZOOM.html'>movement::ZOOM</a></li><li><a href='upzone/constant.ZOOM.html'>upzone::ZOOM</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "experiment";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
<span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='animation/struct.Animator.html'>animation::Animator</a></li><li><a href='animation/struct.Effect.html'>animation::Effect</a></li><li><a href='animation/struct.SnowEffect.html'>animation::SnowEffect</a></li><li><a href='animation/struct.Snowflake.html'>animation::Snowflake</a></li><li><a href='buildings/struct.Buildings.html'>buildings::Buildings</a></li><li><a href='controls/struct.InstantController.html'>controls::InstantController</a></li><li><a href='game/struct.EnergylessArrow.html'>game::EnergylessArrow</a></li><li><a href='game/struct.Game.html'>game::Game</a></li><li><a href='game/struct.GameState.html'>game::GameState</a></li><li><a href='levels/struct.Level.html'>levels::Level</a></li><li><a href='levels/struct.TitleScreen.html'>levels::TitleScreen</a></li><li><a href='movement/struct.BuildingsAlongRoad.html'>movement::BuildingsAlongRoad</a></li><li><a href='movement/struct.Player.html'>movement::Player</a></li><li><a href='upzone/struct.Picker.html'>upzone::Picker</a></li><li><a href='vehicles/struct.Vehicle.html'>vehicles::Vehicle</a></li></ul><h3 id='Enums'>Enums</h3><ul class='enums docblock'><li><a href='buildings/enum.BldgState.html'>buildings::BldgState</a></li><li><a href='movement/enum.On.html'>movement::On</a></li></ul><h3 id='Functions'>Functions</h3><ul class='functions docblock'><li><a href='levels/fn.all_levels.html'>levels::all_levels</a></li><li><a href='fn.main.html'>main</a></li><li><a href='meters/fn.custom_bar.html'>meters::custom_bar</a></li><li><a href='meters/fn.make_bar.html'>meters::make_bar</a></li></ul><h3 id='Constants'>Constants</h3><ul class='constants docblock'><li><a href='controls/constant.HACK.html'>controls::HACK</a></li><li><a href='game/constant.ACQUIRE_BOOST_RATE.html'>game::ACQUIRE_BOOST_RATE</a></li><li><a href='game/constant.BOOST_SPEED_MULTIPLIER.html'>game::BOOST_SPEED_MULTIPLIER</a></li><li><a href='movement/constant.ZOOM.html'>movement::ZOOM</a></li><li><a href='upzone/constant.ZOOM.html'>upzone::ZOOM</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "experiment";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +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 `ACQUIRE_BOOST_RATE` constant in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, ACQUIRE_BOOST_RATE"><title>experiment::game::ACQUIRE_BOOST_RATE - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/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'>experiment</a>::<wbr><a href='index.html'>game</a></p><script>window.sidebarCurrent = {name: 'ACQUIRE_BOOST_RATE', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/game.rs.html#20' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>game</a>::<wbr><a class="constant" href=''>ACQUIRE_BOOST_RATE</a></span></h1><pre class='rust const'>const ACQUIRE_BOOST_RATE: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a> = 0.5;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -0,0 +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 `BOOST_SPEED_MULTIPLIER` constant in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, BOOST_SPEED_MULTIPLIER"><title>experiment::game::BOOST_SPEED_MULTIPLIER - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/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'>experiment</a>::<wbr><a href='index.html'>game</a></p><script>window.sidebarCurrent = {name: 'BOOST_SPEED_MULTIPLIER', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/game.rs.html#21' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>game</a>::<wbr><a class="constant" href=''>BOOST_SPEED_MULTIPLIER</a></span></h1><pre class='rust const'>const BOOST_SPEED_MULTIPLIER: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a> = 1.5;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `game` mod in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, game"><title>experiment::game - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module game</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../index.html'>experiment</a></p><script>window.sidebarCurrent = {name: 'game', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/game.rs.html#1-391' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>game</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.EnergylessArrow.html" title='experiment::game::EnergylessArrow struct'>EnergylessArrow</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Game.html" title='experiment::game::Game struct'>Game</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.GameState.html" title='experiment::game::GameState struct'>GameState</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 = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module game</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li></ul></div><p class='location'><a href='../index.html'>experiment</a></p><script>window.sidebarCurrent = {name: 'game', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/game.rs.html#1-436' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>game</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.EnergylessArrow.html" title='experiment::game::EnergylessArrow struct'>EnergylessArrow</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Game.html" title='experiment::game::Game struct'>Game</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.GameState.html" title='experiment::game::GameState struct'>GameState</a></td><td class='docblock-short'></td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
<table><tr class='module-item'><td><a class="constant" href="constant.ACQUIRE_BOOST_RATE.html" title='experiment::game::ACQUIRE_BOOST_RATE constant'>ACQUIRE_BOOST_RATE</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.BOOST_SPEED_MULTIPLIER.html" title='experiment::game::BOOST_SPEED_MULTIPLIER constant'>BOOST_SPEED_MULTIPLIER</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 = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1 +1 @@
initSidebarItems({"struct":[["EnergylessArrow",""],["Game",""],["GameState",""]]});
initSidebarItems({"constant":[["ACQUIRE_BOOST_RATE",""],["BOOST_SPEED_MULTIPLIER",""]],"struct":[["EnergylessArrow",""],["Game",""],["GameState",""]]});

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

@ -0,0 +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 `custom_bar` fn in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, custom_bar"><title>experiment::meters::custom_bar - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/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'>experiment</a>::<wbr><a href='index.html'>meters</a></p><script>window.sidebarCurrent = {name: 'custom_bar', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/meters.rs.html#5-25' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>meters</a>::<wbr><a class="fn" href=''>custom_bar</a></span></h1><pre class='rust fn'>pub fn custom_bar(<br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;filled_color: Color, <br>&nbsp;&nbsp;&nbsp;&nbsp;pct_full: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;txt: Text<br>) -&gt; Widget</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></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 `make_bar` fn in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, make_bar"><title>experiment::meters::make_bar - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/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'>experiment</a>::<wbr><a href='index.html'>meters</a></p><script>window.sidebarCurrent = {name: 'make_bar', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/meters.rs.html#5-31' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>meters</a>::<wbr><a class="fn" href=''>make_bar</a></span></h1><pre class='rust fn'>pub fn make_bar(<br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;filled_color: Color, <br>&nbsp;&nbsp;&nbsp;&nbsp;value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;max: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><br>) -&gt; Widget</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/meters.rs.html#27-35' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>meters</a>::<wbr><a class="fn" href=''>make_bar</a></span></h1><pre class='rust fn'>pub fn make_bar(<br>&nbsp;&nbsp;&nbsp;&nbsp;ctx: &amp;mut EventCtx&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;filled_color: Color, <br>&nbsp;&nbsp;&nbsp;&nbsp;value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;max: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><br>) -&gt; Widget</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `meters` mod in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, meters"><title>experiment::meters - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module meters</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>experiment</a></p><script>window.sidebarCurrent = {name: 'meters', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/meters.rs.html#1-31' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>meters</a></span></h1><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table><tr class='module-item'><td><a class="fn" href="fn.make_bar.html" title='experiment::meters::make_bar fn'>make_bar</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 = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/meters.rs.html#1-35' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>meters</a></span></h1><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table><tr class='module-item'><td><a class="fn" href="fn.custom_bar.html" title='experiment::meters::custom_bar fn'>custom_bar</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.make_bar.html" title='experiment::meters::make_bar fn'>make_bar</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 = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -1 +1 @@
initSidebarItems({"fn":[["make_bar",""]]});
initSidebarItems({"fn":[["custom_bar",""],["make_bar",""]]});

View File

@ -1,12 +1,12 @@
<!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 `On` enum in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, On"><title>experiment::movement::On - 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 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 enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum On</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Intersection">Intersection</a><a href="#variant.Road">Road</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</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&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></div></div><p class='location'><a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a></p><script>window.sidebarCurrent = {name: 'On', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#140-144' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a>::<wbr><a class="enum" href=''>On</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>enum On {
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#152-156' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a>::<wbr><a class="enum" href=''>On</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>enum On {
Intersection(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>),
Road(<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>,&nbsp;<a class="struct" href="../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a>),
}</pre></div><h2 id='variants' class='variants small-section-header'>
Variants<a href='#variants' class='anchor'></a></h2>
<div id="variant.Intersection" class="variant small-section-header"><a href="#variant.Intersection" class="anchor field"></a><code>Intersection(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></div><div id="variant.Road" class="variant small-section-header"><a href="#variant.Road" class="anchor field"></a><code>Road(<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>,&nbsp;<a class="struct" href="../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a>)</code></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-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#139' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#139' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
<div id="variant.Intersection" class="variant small-section-header"><a href="#variant.Intersection" class="anchor field"></a><code>Intersection(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></div><div id="variant.Road" class="variant small-section-header"><a href="#variant.Road" class="anchor field"></a><code>Road(<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>,&nbsp;<a class="struct" href="../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a>)</code></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-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#151' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#151' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></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="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-RefUnwindSafe' class='anchor'></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="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Send' class='anchor'></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="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Sync' class='anchor'></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="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Unpin' class='anchor'></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="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `movement` mod in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, movement"><title>experiment::movement - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module movement</p><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="#constants">Constants</a></li></ul></div><p class='location'><a href='../index.html'>experiment</a></p><script>window.sidebarCurrent = {name: 'movement', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#1-190' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>movement</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#1-202' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>movement</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.BuildingsAlongRoad.html" title='experiment::movement::BuildingsAlongRoad struct'>BuildingsAlongRoad</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Player.html" title='experiment::movement::Player struct'>Player</a></td><td class='docblock-short'></td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table><tr class='module-item'><td><a class="enum" href="enum.On.html" title='experiment::movement::On enum'>On</a></td><td class='docblock-short'></td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
<table><tr class='module-item'><td><a class="constant" href="constant.ZOOM.html" title='experiment::movement::ZOOM constant'>ZOOM</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 = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,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 `vehicles` mod in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, vehicles"><title>experiment::vehicles - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module vehicles</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../index.html'>experiment</a></p><script>window.sidebarCurrent = {name: 'vehicles', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/vehicles.rs.html#1-63' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>vehicles</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/experiment/vehicles.rs.html#1-67' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>vehicles</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.Vehicle.html" title='experiment::vehicles::Vehicle struct'>Vehicle</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 = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a></p><script>window.sidebarCurrent = {name: 'BUILT_TIME_UTC', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><span class="help-button">?</span>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-f38555f90777146b/out/built.rs.html#49' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a>::<wbr><a class="constant" href=''>BUILT_TIME_UTC</a></span></h1><pre class='rust const'>pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Thu, 03 Dec 2020 23:24:17 +0000&quot;;</pre><div class='docblock'><p>The built-time in RFC2822, UTC</p>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-f38555f90777146b/out/built.rs.html#49' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a>::<wbr><a class="constant" href=''>BUILT_TIME_UTC</a></span></h1><pre class='rust const'>pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Fri, 04 Dec 2020 04:51:48 +0000&quot;;</pre><div class='docblock'><p>The built-time in RFC2822, UTC</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -392,6 +392,51 @@
<span id="389">389</span>
<span id="390">390</span>
<span id="391">391</span>
<span id="392">392</span>
<span id="393">393</span>
<span id="394">394</span>
<span id="395">395</span>
<span id="396">396</span>
<span id="397">397</span>
<span id="398">398</span>
<span id="399">399</span>
<span id="400">400</span>
<span id="401">401</span>
<span id="402">402</span>
<span id="403">403</span>
<span id="404">404</span>
<span id="405">405</span>
<span id="406">406</span>
<span id="407">407</span>
<span id="408">408</span>
<span id="409">409</span>
<span id="410">410</span>
<span id="411">411</span>
<span id="412">412</span>
<span id="413">413</span>
<span id="414">414</span>
<span id="415">415</span>
<span id="416">416</span>
<span id="417">417</span>
<span id="418">418</span>
<span id="419">419</span>
<span id="420">420</span>
<span id="421">421</span>
<span id="422">422</span>
<span id="423">423</span>
<span id="424">424</span>
<span id="425">425</span>
<span id="426">426</span>
<span id="427">427</span>
<span id="428">428</span>
<span id="429">429</span>
<span id="430">430</span>
<span id="431">431</span>
<span id="432">432</span>
<span id="433">433</span>
<span id="434">434</span>
<span id="435">435</span>
<span id="436">436</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">HashSet</span>;
@ -408,14 +453,18 @@
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">animation</span>::{<span class="ident">Animator</span>, <span class="ident">SnowEffect</span>};
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">buildings</span>::{<span class="ident">BldgState</span>, <span class="ident">Buildings</span>};
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">levels</span>::<span class="ident">Level</span>;
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">meters</span>::<span class="ident">make_bar</span>;
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">meters</span>::{<span class="ident">custom_bar</span>, <span class="ident">make_bar</span>};
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">movement</span>::<span class="ident">Player</span>;
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">vehicles</span>::<span class="ident">Vehicle</span>;
<span class="kw">const</span> <span class="ident">ACQUIRE_BOOST_RATE</span>: <span class="ident">f64</span> <span class="op">=</span> <span class="number">0.5</span>;
<span class="kw">const</span> <span class="ident">BOOST_SPEED_MULTIPLIER</span>: <span class="ident">f64</span> <span class="op">=</span> <span class="number">1.5</span>;
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Game</span> {
<span class="ident">title_panel</span>: <span class="ident">Panel</span>,
<span class="ident">status_panel</span>: <span class="ident">Panel</span>,
<span class="ident">time_panel</span>: <span class="ident">Panel</span>,
<span class="ident">boost_panel</span>: <span class="ident">Panel</span>,
<span class="ident">minimap</span>: <span class="ident">SimpleMinimap</span>,
<span class="ident">animator</span>: <span class="ident">Animator</span>,
@ -466,6 +515,15 @@
.<span class="ident">aligned</span>(<span class="ident">HorizontalAlignment</span>::<span class="ident">LeftInset</span>, <span class="ident">VerticalAlignment</span>::<span class="ident">TopInset</span>)
.<span class="ident">build</span>(<span class="ident">ctx</span>);
<span class="kw">let</span> <span class="ident">boost_panel</span> <span class="op">=</span> <span class="ident">Panel</span>::<span class="ident">new</span>(<span class="ident">Widget</span>::<span class="ident">row</span>(<span class="macro">vec</span><span class="macro">!</span>[
<span class="string">&quot;Boost&quot;</span>.<span class="ident">draw_text</span>(<span class="ident">ctx</span>),
<span class="ident">Widget</span>::<span class="ident">draw_batch</span>(<span class="ident">ctx</span>, <span class="ident">GeomBatch</span>::<span class="ident">new</span>())
.<span class="ident">named</span>(<span class="string">&quot;boost&quot;</span>)
.<span class="ident">align_right</span>(),
]))
.<span class="ident">aligned</span>(<span class="ident">HorizontalAlignment</span>::<span class="ident">Center</span>, <span class="ident">VerticalAlignment</span>::<span class="ident">BottomInset</span>)
.<span class="ident">build</span>(<span class="ident">ctx</span>);
<span class="kw">let</span> <span class="ident">start</span> <span class="op">=</span> <span class="ident">app</span>
.<span class="ident">map</span>
.<span class="ident">find_i_by_osm_id</span>(<span class="ident">level</span>.<span class="ident">start</span>)
@ -480,6 +538,7 @@
<span class="ident">title_panel</span>,
<span class="ident">status_panel</span>,
<span class="ident">time_panel</span>,
<span class="ident">boost_panel</span>,
<span class="ident">minimap</span>: <span class="ident">SimpleMinimap</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">with_zorder</span>),
<span class="ident">animator</span>: <span class="ident">Animator</span>::<span class="ident">new</span>(<span class="ident">ctx</span>),
@ -514,6 +573,18 @@
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">vehicle</span>.<span class="ident">max_energy</span>,
);
<span class="self">self</span>.<span class="ident">status_panel</span>.<span class="ident">replace</span>(<span class="ident">ctx</span>, <span class="string">&quot;energy&quot;</span>, <span class="ident">energy_bar</span>);
<span class="kw">let</span> <span class="ident">boost_bar</span> <span class="op">=</span> <span class="ident">custom_bar</span>(
<span class="ident">ctx</span>,
<span class="ident">Color</span>::<span class="ident">hex</span>(<span class="string">&quot;#A32015&quot;</span>),
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span> <span class="op">/</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">vehicle</span>.<span class="ident">max_boost</span>,
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span> <span class="op">=</span><span class="op">=</span> <span class="ident">Duration</span>::<span class="ident">ZERO</span> {
<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="string">&quot;Find a bike or bus lane to get a boost&quot;</span>))
} <span class="kw">else</span> {
<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="string">&quot;Press space to boost&quot;</span>))
},
);
<span class="self">self</span>.<span class="ident">boost_panel</span>.<span class="ident">replace</span>(<span class="ident">ctx</span>, <span class="string">&quot;boost&quot;</span>, <span class="ident">boost_bar</span>);
}
}
@ -523,11 +594,21 @@
<span class="self">self</span>.<span class="ident">time</span> <span class="op">+</span><span class="op">=</span> <span class="ident">dt</span>;
}
<span class="kw">let</span> <span class="ident">speed</span> <span class="op">=</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">has_energy</span>() {
<span class="kw">let</span> <span class="ident">base_speed</span> <span class="op">=</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">has_energy</span>() {
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">vehicle</span>.<span class="ident">normal_speed</span>
} <span class="kw">else</span> {
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">vehicle</span>.<span class="ident">tired_speed</span>
};
<span class="kw">let</span> <span class="ident">speed</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">ctx</span>.<span class="ident">is_key_down</span>(<span class="ident">Key</span>::<span class="ident">Space</span>) <span class="op">&amp;&amp;</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span> <span class="op">&gt;</span> <span class="ident">Duration</span>::<span class="ident">ZERO</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">dt</span>) <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">input</span>.<span class="ident">nonblocking_is_update_event</span>() {
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span> <span class="op">-</span><span class="op">=</span> <span class="ident">dt</span>;
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span>.<span class="ident">max</span>(<span class="ident">Duration</span>::<span class="ident">ZERO</span>);
}
<span class="ident">base_speed</span> <span class="op">*</span> <span class="ident">BOOST_SPEED_MULTIPLIER</span>
} <span class="kw">else</span> {
<span class="ident">base_speed</span>
};
<span class="kw">for</span> <span class="ident">b</span> <span class="kw">in</span> <span class="self">self</span>.<span class="ident">player</span>.<span class="ident">update_with_speed</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">speed</span>) {
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">bldgs</span>.<span class="ident">buildings</span>[<span class="kw-2">&amp;</span><span class="ident">b</span>] {
<span class="ident">BldgState</span>::<span class="ident">Undelivered</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">&gt;</span> {
@ -563,6 +644,12 @@
<span class="ident">BldgState</span>::<span class="ident">Done</span> <span class="op">=</span><span class="op">&gt;</span> {}
}
}
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">dt</span>) <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">input</span>.<span class="ident">nonblocking_is_update_event</span>() {
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">player</span>.<span class="ident">on_good_road</span>(<span class="ident">app</span>) {
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span> <span class="op">+</span><span class="op">=</span> <span class="ident">dt</span> <span class="op">*</span> <span class="ident">ACQUIRE_BOOST_RATE</span>;
<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">state</span>.<span class="ident">boost</span>.<span class="ident">min</span>(<span class="self">self</span>.<span class="ident">state</span>.<span class="ident">vehicle</span>.<span class="ident">max_boost</span>);
}
}
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">t</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">minimap</span>.<span class="ident">event</span>(<span class="ident">ctx</span>, <span class="ident">app</span>) {
<span class="kw">return</span> <span class="ident">t</span>;
@ -617,6 +704,7 @@
<span class="self">self</span>.<span class="ident">title_panel</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
<span class="self">self</span>.<span class="ident">status_panel</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
<span class="self">self</span>.<span class="ident">time_panel</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
<span class="self">self</span>.<span class="ident">boost_panel</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
<span class="kw">let</span> <span class="ident">santa_tracker</span> <span class="op">=</span> <span class="ident">g</span>.<span class="ident">upload</span>(<span class="ident">GeomBatch</span>::<span class="ident">from</span>(<span class="macro">vec</span><span class="macro">!</span>[(
<span class="ident">Color</span>::<span class="ident">RED</span>,
@ -666,6 +754,7 @@
<span class="ident">score</span>: <span class="ident">usize</span>,
<span class="comment">// Number of gifts currently being carried</span>
<span class="ident">energy</span>: <span class="ident">usize</span>,
<span class="ident">boost</span>: <span class="ident">Duration</span>,
<span class="ident">draw_done_houses</span>: <span class="ident">Drawable</span>,
<span class="ident">energyless_arrow</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">EnergylessArrow</span><span class="op">&gt;</span>,
@ -687,6 +776,7 @@
<span class="ident">score</span>: <span class="number">0</span>,
<span class="ident">energy</span>,
<span class="ident">boost</span>: <span class="ident">Duration</span>::<span class="ident">ZERO</span>,
<span class="ident">draw_done_houses</span>: <span class="ident">Drawable</span>::<span class="ident">empty</span>(<span class="ident">ctx</span>),
<span class="ident">energyless_arrow</span>: <span class="prelude-val">None</span>,

View File

@ -32,16 +32,19 @@
<span id="29">29</span>
<span id="30">30</span>
<span id="31">31</span>
<span id="32">32</span>
<span id="33">33</span>
<span id="34">34</span>
<span id="35">35</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">abstutil</span>::<span class="ident">prettyprint_usize</span>;
<span class="kw">use</span> <span class="ident">geom</span>::<span class="ident">Polygon</span>;
<span class="kw">use</span> <span class="ident">widgetry</span>::{<span class="ident">Color</span>, <span class="ident">EventCtx</span>, <span class="ident">GeomBatch</span>, <span class="ident">Line</span>, <span class="ident">Text</span>, <span class="ident">Widget</span>};
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">make_bar</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">filled_color</span>: <span class="ident">Color</span>, <span class="ident">value</span>: <span class="ident">usize</span>, <span class="ident">max</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Widget</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">custom_bar</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">filled_color</span>: <span class="ident">Color</span>, <span class="ident">pct_full</span>: <span class="ident">f64</span>, <span class="ident">txt</span>: <span class="ident">Text</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Widget</span> {
<span class="kw">let</span> <span class="ident">total_width</span> <span class="op">=</span> <span class="number">300.0</span>;
<span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="number">32.0</span>;
<span class="kw">let</span> <span class="ident">radius</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="number">4.0</span>);
<span class="kw">let</span> <span class="ident">pct_full</span> <span class="op">=</span> (<span class="ident">value</span> <span class="kw">as</span> <span class="ident">f64</span>) <span class="op">/</span> (<span class="ident">max</span> <span class="kw">as</span> <span class="ident">f64</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">GeomBatch</span>::<span class="ident">new</span>();
<span class="comment">// Background</span>
@ -54,15 +57,20 @@
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">filled_color</span>, <span class="ident">poly</span>);
}
<span class="comment">// Text</span>
<span class="kw">let</span> <span class="ident">label</span> <span class="op">=</span> <span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="macro">format</span><span class="macro">!</span>(
<span class="string">&quot;{} / {}&quot;</span>,
<span class="ident">prettyprint_usize</span>(<span class="ident">value</span>),
<span class="ident">prettyprint_usize</span>(<span class="ident">max</span>)
)))
.<span class="ident">render_to_batch</span>(<span class="ident">ctx</span>.<span class="ident">prerender</span>);
<span class="kw">let</span> <span class="ident">label</span> <span class="op">=</span> <span class="ident">txt</span>.<span class="ident">render_to_batch</span>(<span class="ident">ctx</span>.<span class="ident">prerender</span>);
<span class="kw">let</span> <span class="ident">dims</span> <span class="op">=</span> <span class="ident">label</span>.<span class="ident">get_dims</span>();
<span class="ident">batch</span>.<span class="ident">append</span>(<span class="ident">label</span>.<span class="ident">translate</span>(<span class="number">10.0</span>, <span class="ident">height</span> <span class="op">/</span> <span class="number">2.0</span> <span class="op">-</span> <span class="ident">dims</span>.<span class="ident">height</span> <span class="op">/</span> <span class="number">2.0</span>));
<span class="ident">Widget</span>::<span class="ident">draw_batch</span>(<span class="ident">ctx</span>, <span class="ident">batch</span>)
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">make_bar</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">filled_color</span>: <span class="ident">Color</span>, <span class="ident">value</span>: <span class="ident">usize</span>, <span class="ident">max</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Widget</span> {
<span class="kw">let</span> <span class="ident">pct_full</span> <span class="op">=</span> (<span class="ident">value</span> <span class="kw">as</span> <span class="ident">f64</span>) <span class="op">/</span> (<span class="ident">max</span> <span class="kw">as</span> <span class="ident">f64</span>);
<span class="kw">let</span> <span class="ident">txt</span> <span class="op">=</span> <span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="macro">format</span><span class="macro">!</span>(
<span class="string">&quot;{} / {}&quot;</span>,
<span class="ident">prettyprint_usize</span>(<span class="ident">value</span>),
<span class="ident">prettyprint_usize</span>(<span class="ident">max</span>)
)));
<span class="ident">custom_bar</span>(<span class="ident">ctx</span>, <span class="ident">filled_color</span>, <span class="ident">pct_full</span>, <span class="ident">txt</span>)
}
</pre></div>
</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "experiment";</script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>

View File

@ -191,13 +191,25 @@
<span id="188">188</span>
<span id="189">189</span>
<span id="190">190</span>
<span id="191">191</span>
<span id="192">192</span>
<span id="193">193</span>
<span id="194">194</span>
<span id="195">195</span>
<span id="196">196</span>
<span id="197">197</span>
<span id="198">198</span>
<span id="199">199</span>
<span id="200">200</span>
<span id="201">201</span>
<span id="202">202</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">HashMap</span>;
<span class="kw">use</span> <span class="ident">abstutil</span>::<span class="ident">MultiMap</span>;
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Angle</span>, <span class="ident">Circle</span>, <span class="ident">Distance</span>, <span class="ident">Pt2D</span>, <span class="ident">Speed</span>};
<span class="kw">use</span> <span class="ident">map_gui</span>::{<span class="ident">SimpleApp</span>, <span class="ident">ID</span>};
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">BuildingID</span>, <span class="ident">Direction</span>, <span class="ident">IntersectionID</span>, <span class="ident">RoadID</span>};
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">BuildingID</span>, <span class="ident">Direction</span>, <span class="ident">IntersectionID</span>, <span class="ident">LaneType</span>, <span class="ident">RoadID</span>};
<span class="kw">use</span> <span class="ident">widgetry</span>::<span class="ident">EventCtx</span>;
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">controls</span>::<span class="ident">InstantController</span>;
@ -328,6 +340,18 @@
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_angle</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Angle</span> {
<span class="self">self</span>.<span class="ident">controls</span>.<span class="ident">facing</span>
}
<span class="doccomment">/// Is the player currently on a road with a bus or bike lane?</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">on_good_road</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">app</span>: <span class="kw-2">&amp;</span><span class="ident">SimpleApp</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">bool</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">On</span>::<span class="ident">Road</span>(<span class="ident">r</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">on</span> {
<span class="kw">for</span> (<span class="kw">_</span>, <span class="kw">_</span>, <span class="ident">lt</span>) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_r</span>(<span class="ident">r</span>).<span class="ident">lanes_ltr</span>() {
<span class="kw">if</span> <span class="ident">lt</span> <span class="op">=</span><span class="op">=</span> <span class="ident">LaneType</span>::<span class="ident">Biking</span> <span class="op">|</span><span class="op">|</span> <span class="ident">lt</span> <span class="op">=</span><span class="op">=</span> <span class="ident">LaneType</span>::<span class="ident">Bus</span> {
<span class="kw">return</span> <span class="bool-val">true</span>;
}
}
}
<span class="bool-val">false</span>
}
}
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span>

View File

@ -64,8 +64,12 @@
<span id="61">61</span>
<span id="62">62</span>
<span id="63">63</span>
<span id="64">64</span>
<span id="65">65</span>
<span id="66">66</span>
<span id="67">67</span>
</pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Speed</span>, <span class="ident">Time</span>};
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Duration</span>, <span class="ident">Speed</span>, <span class="ident">Time</span>};
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Vehicle</span> {
<span class="kw">pub</span> <span class="ident">name</span>: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static</span> <span class="ident">str</span>,
@ -73,6 +77,7 @@
<span class="kw">pub</span> <span class="ident">normal_speed</span>: <span class="ident">Speed</span>,
<span class="kw">pub</span> <span class="ident">tired_speed</span>: <span class="ident">Speed</span>,
<span class="kw">pub</span> <span class="ident">max_energy</span>: <span class="ident">usize</span>,
<span class="kw">pub</span> <span class="ident">max_boost</span>: <span class="ident">Duration</span>,
<span class="comment">// Paths to SVGs to draw in sequence</span>
<span class="kw">pub</span> <span class="ident">draw_frames</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="lifetime">&#39;static</span> <span class="ident">str</span><span class="op">&gt;</span>,
@ -87,6 +92,7 @@
<span class="ident">normal_speed</span>: <span class="ident">Speed</span>::<span class="ident">miles_per_hour</span>(<span class="number">30.0</span>),
<span class="ident">tired_speed</span>: <span class="ident">Speed</span>::<span class="ident">miles_per_hour</span>(<span class="number">10.0</span>),
<span class="ident">max_energy</span>: <span class="number">80</span>,
<span class="ident">max_boost</span>: <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">5.0</span>),
<span class="ident">draw_frames</span>: <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&quot;sleigh.svg&quot;</span>],
},
@ -96,6 +102,7 @@
<span class="ident">normal_speed</span>: <span class="ident">Speed</span>::<span class="ident">miles_per_hour</span>(<span class="number">40.0</span>),
<span class="ident">tired_speed</span>: <span class="ident">Speed</span>::<span class="ident">miles_per_hour</span>(<span class="number">15.0</span>),
<span class="ident">max_energy</span>: <span class="number">50</span>,
<span class="ident">max_boost</span>: <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">8.0</span>),
<span class="ident">draw_frames</span>: <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&quot;bike1.svg&quot;</span>, <span class="string">&quot;bike2.svg&quot;</span>, <span class="string">&quot;bike1.svg&quot;</span>, <span class="string">&quot;bike3.svg&quot;</span>],
},
@ -105,6 +112,7 @@
<span class="ident">normal_speed</span>: <span class="ident">Speed</span>::<span class="ident">miles_per_hour</span>(<span class="number">40.0</span>),
<span class="ident">tired_speed</span>: <span class="ident">Speed</span>::<span class="ident">miles_per_hour</span>(<span class="number">5.0</span>),
<span class="ident">max_energy</span>: <span class="number">150</span>,
<span class="ident">max_boost</span>: <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">10.0</span>),
<span class="ident">draw_frames</span>: <span class="macro">vec</span><span class="macro">!</span>[
<span class="string">&quot;cargo_bike1.svg&quot;</span>,

View File

@ -114,7 +114,7 @@
<span class="doccomment">/// The output of `rustdoc -V`</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;rustdoc 1.48.0 (7eac88abb 2020-11-16)&quot;</span>;
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Thu, 03 Dec 2020 23:24:17 +0000&quot;</span>;
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Fri, 04 Dec 2020 04:51:48 +0000&quot;</span>;
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;x86_64&quot;</span>;
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>