Constant game::pregame::built_info::BUILT_TIME_UTC [−][src]
pub const BUILT_TIME_UTC: &str = r"Fri, 17 Sep 2021 19:42:31 +0000";
Expand description
The build time in RFC2822, UTC.
+Constant game::pregame::built_info::BUILT_TIME_UTC [−][src]
pub const BUILT_TIME_UTC: &str = r"Fri, 17 Sep 2021 19:44:47 +0000";
Expand description
The build time in RFC2822, UTC.
Module game::ungap::route [−][src]
Structs
+Module game::ungap::route [−][src]
Structs
Save sequences of waypoints as named routes. Basic file management – save, load, browse. This is useful to define “test cases,” then edit the bike network and “run the tests” to compare results.
diff --git a/rustdoc/game/ungap/route/struct.RenameEdits.html b/rustdoc/game/ungap/route/struct.RenameEdits.html index 39462155dc..fc55815f69 100644 --- a/rustdoc/game/ungap/route/struct.RenameEdits.html +++ b/rustdoc/game/ungap/route/struct.RenameEdits.html @@ -1,11 +1,11 @@ -Struct game::ungap::route::RenameEdits [−][src]
struct RenameEdits { +RenameEdits in game::ungap::route - Rust Struct game::
ungap:: [−][src]route:: RenameEdits Fields
current_name: String
all_names: HashSet<String>
Implementations
fn new_state(
ctx: &mut EventCtx<'_>,
current: &NamedRoute,
all: &SavedRoutes
) -> Box<dyn State<App>>Trait Implementations
Called when something on the panel has been clicked. Since the action is just a string, +}
Fields
current_name: String
all_names: HashSet<String>
Implementations
fn new_state(
ctx: &mut EventCtx<'_>,
current: &NamedRoute,
all: &SavedRoutes
) -> Box<dyn State<App>>Trait Implementations
Called when something on the panel has been clicked. Since the action is just a string, the fallback case can just use
-unreachable!()
. Read more
fn panel_changed(
&mut self,
ctx: &mut EventCtx<'_>,
_: &mut App,
panel: &mut Panel
) -> Option<Transition<App>>Called when something on the panel has changed. If a transition is returned, stop handling +
fn panel_changed(
&mut self,
ctx: &mut EventCtx<'_>,
_: &mut App,
panel: &mut Panel
) -> Option<Transition<App>>Called when something on the panel has changed. If a transition is returned, stop handling the event and immediately apply the transition. Read more
-
fn on_click_custom(
&mut self,
_ctx: &mut EventCtx<'_>,
_app: &mut A,
_action: Box<dyn CloneableAny + 'static, Global>,
_panel: &Panel
) -> Transition<A>Called when something on the panel has been clicked.
+
fn on_click_custom(
&mut self,
_ctx: &mut EventCtx<'_>,
_app: &mut A,
_action: Box<dyn CloneableAny + 'static, Global>,
_panel: &Panel
) -> Transition<A>Called when something on the panel has been clicked.
fn on_mouseover(&mut self, &mut EventCtx<'_>, &mut A)
Called when the mouse has moved.
fn other_event(&mut self, &mut EventCtx<'_>, &mut A) -> Transition<A>
If a panel
diff --git a/rustdoc/game/ungap/route/struct.RouteManagement.html b/rustdoc/game/ungap/route/struct.RouteManagement.html index ebd08a702e..37c2c952dc 100644 --- a/rustdoc/game/ungap/route/struct.RouteManagement.html +++ b/rustdoc/game/ungap/route/struct.RouteManagement.html @@ -4,7 +4,7 @@ }on_click
event didn’t occur andpanel_changed
didn’t return transition, then call this to handle all other events. Read moreExpand description
Save sequences of waypoints as named routes. Basic file management – save, load, browse. This is useful to define “test cases,” then edit the bike network and “run the tests” to compare results.
-Fields
current: NamedRoute
all: SavedRoutes
Implementations
Auto Trait Implementations
impl RefUnwindSafe for RouteManagement
impl Send for RouteManagement
impl Sync for RouteManagement
impl Unpin for RouteManagement
impl UnwindSafe for RouteManagement
Blanket Implementations
Fields
current: NamedRoute
all: SavedRoutes
Implementations
Auto Trait Implementations
impl RefUnwindSafe for RouteManagement
impl Send for RouteManagement
impl Sync for RouteManagement
impl Unpin for RouteManagement
impl UnwindSafe for RouteManagement
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,Convert
Box<dyn Trait>
(whereTrait: Downcast
) toBox<dyn Any>
.Box<dyn Any>
can diff --git a/rustdoc/game/ungap/route/struct.SavedRoutes.html b/rustdoc/game/ungap/route/struct.SavedRoutes.html index 9e2e08cbb7..a2b776280e 100644 --- a/rustdoc/game/ungap/route/struct.SavedRoutes.html +++ b/rustdoc/game/ungap/route/struct.SavedRoutes.html @@ -1,6 +1,6 @@SavedRoutes in game::ungap::route - Rust Struct game::
ungap:: [−][src]route:: SavedRoutes struct SavedRoutes { routes: BTreeMap<String, NamedRoute>, -}Fields
routes: BTreeMap<String, NamedRoute>
Implementations
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,Deserialize this value from the given Serde deserializer. Read more
+}Fields
routes: BTreeMap<String, NamedRoute>
Implementations
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for SavedRoutes
impl Send for SavedRoutes
impl Sync for SavedRoutes
impl Unpin for SavedRoutes
impl UnwindSafe for SavedRoutes
Blanket Implementations
Immutably borrows from an owned value. Read more
diff --git a/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-0716a03cc01a18cb/out/built.rs.html b/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-0716a03cc01a18cb/out/built.rs.html index 0101b86e02..60cb5e76af 100644 --- a/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-0716a03cc01a18cb/out/built.rs.html +++ b/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-0716a03cc01a18cb/out/built.rs.html @@ -175,7 +175,7 @@ pub const RUSTDOC_VERSION: &str = r"rustdoc 1.55.0 (c8dfcfe04 2021-09-06)"; #[doc=r#"The build time in RFC2822, UTC."#] #[allow(dead_code)] -pub const BUILT_TIME_UTC: &str = r"Fri, 17 Sep 2021 19:42:31 +0000"; +pub const BUILT_TIME_UTC: &str = r"Fri, 17 Sep 2021 19:44:47 +0000"; #[doc=r#"The target architecture, given by `CARGO_CFG_TARGET_ARCH`."#] #[allow(dead_code)] pub const CFG_TARGET_ARCH: &str = r"x86_64"; diff --git a/rustdoc/src/game/ungap/route.rs.html b/rustdoc/src/game/ungap/route.rs.html index bfcb775853..779d3f8ccd 100644 --- a/rustdoc/src/game/ungap/route.rs.html +++ b/rustdoc/src/game/ungap/route.rs.html @@ -729,6 +729,15 @@ 729 730 731 +732 +733 +734 +735 +736 +737 +738 +739 +740use std::collections::{BTreeMap, HashSet}; @@ -1219,16 +1228,25 @@ } fn prev(&self, current: &str) -> Option<&NamedRoute> { - self.routes - .range(..current.to_string()) - .next_back() - .map(|pair| pair.1) + // Pretend unsaved routes are at the end of the list + if self.routes.contains_key(current) { + self.routes + .range(..current.to_string()) + .next_back() + .map(|pair| pair.1) + } else { + self.routes.values().last() + } } fn next(&self, current: &str) -> Option<&NamedRoute> { - let mut iter = self.routes.range(current.to_string()..); - iter.next(); - iter.next().map(|pair| pair.1) + if self.routes.contains_key(current) { + let mut iter = self.routes.range(current.to_string()..); + iter.next(); + iter.next().map(|pair| pair.1) + } else { + None + } } fn new_name(&self) -> String {