pub struct WeatherSystem {Show 13 fields
pub current: WeatherType,
pub target: WeatherType,
pub blend: f32,
pub transition_speed: f32,
pub cloud_coverage: f32,
pub precipitation: f32,
pub wind_speed: f32,
pub wind_dir: Vec2,
pub visibility: f32,
pub temperature: f32,
pub humidity: f32,
pub lightning_chance: f32,
pub thunder_delay: f32,
/* private fields */
}Expand description
Weather system with transition and effects.
Fields§
§current: WeatherType§target: WeatherType§blend: f32§transition_speed: f32§cloud_coverage: f32§precipitation: f32§wind_speed: f32§wind_dir: Vec2§visibility: f32§temperature: f32§humidity: f32§lightning_chance: f32§thunder_delay: f32Implementations§
Source§impl WeatherSystem
impl WeatherSystem
pub fn new() -> Self
pub fn transition_to(&mut self, weather: WeatherType, speed: f32)
pub fn tick(&mut self, dt: f32)
pub fn is_raining(&self) -> bool
pub fn is_snowing(&self) -> bool
pub fn push_forecast(&mut self, weather: WeatherType, duration_secs: f32)
pub fn advance_forecast(&mut self)
Trait Implementations§
Source§impl Clone for WeatherSystem
impl Clone for WeatherSystem
Source§fn clone(&self) -> WeatherSystem
fn clone(&self) -> WeatherSystem
Returns a duplicate 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 Debug for WeatherSystem
impl Debug for WeatherSystem
Auto Trait Implementations§
impl Freeze for WeatherSystem
impl RefUnwindSafe for WeatherSystem
impl Send for WeatherSystem
impl Sync for WeatherSystem
impl Unpin for WeatherSystem
impl UnsafeUnpin for WeatherSystem
impl UnwindSafe for WeatherSystem
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.