pub enum GameplayMode {
Freeform(MapName),
PlayScenario(MapName, String, Vec<ScenarioModifier>),
FixTrafficSignals,
OptimizeCommute(OrigPersonID, Duration),
Actdev(MapName, String, bool),
Tutorial(TutorialPointer),
}
Variants§
Freeform(MapName)
PlayScenario(MapName, String, Vec<ScenarioModifier>)
FixTrafficSignals
OptimizeCommute(OrigPersonID, Duration)
Actdev(MapName, String, bool)
Tutorial(TutorialPointer)
Implementations§
Source§impl GameplayMode
impl GameplayMode
pub fn map_name(&self) -> MapName
pub fn scenario( &self, app: &App, rng: XorShiftRng, timer: &mut Timer<'_>, ) -> LoadScenario
pub fn can_edit_roads(&self) -> bool
pub fn can_edit_stop_signs(&self) -> bool
pub fn can_jump_to_time(&self) -> bool
pub fn allows(&self, edits: &MapEdits) -> bool
Sourcepub fn initialize(
&self,
ctx: &mut EventCtx<'_>,
app: &mut App,
) -> Box<dyn GameplayState>
pub fn initialize( &self, ctx: &mut EventCtx<'_>, app: &mut App, ) -> Box<dyn GameplayState>
Must be called after the scenario has been setup. The caller will call recreate_panels after this, so each constructor doesn’t need to.
Trait Implementations§
Source§impl Clone for GameplayMode
impl Clone for GameplayMode
Source§fn clone(&self) -> GameplayMode
fn clone(&self) -> GameplayMode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Ord for GameplayMode
impl Ord for GameplayMode
Source§fn cmp(&self, other: &GameplayMode) -> Ordering
fn cmp(&self, other: &GameplayMode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GameplayMode
impl PartialEq for GameplayMode
Source§impl PartialOrd for GameplayMode
impl PartialOrd for GameplayMode
impl Eq for GameplayMode
impl StructuralPartialEq for GameplayMode
Auto Trait Implementations§
impl Freeze for GameplayMode
impl RefUnwindSafe for GameplayMode
impl Send for GameplayMode
impl Sync for GameplayMode
impl Unpin for GameplayMode
impl UnwindSafe for GameplayMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more