Struct veloren_common::weather::WeatherGrid
source · pub struct WeatherGrid {
weather: Grid<Weather>,
}
Fields§
§weather: Grid<Weather>
Implementations§
source§impl WeatherGrid
impl WeatherGrid
pub fn new(size: Vec2<u32>) -> Self
pub fn iter(&self) -> impl Iterator<Item = (Vec2<i32>, &Weather)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (Vec2<i32>, &mut Weather)>
pub fn size(&self) -> Vec2<u32>
pub fn get(&self, cell_pos: Vec2<u32>) -> Weather
sourcepub fn get_interpolated(&self, wpos: Vec2<f32>) -> Weather
pub fn get_interpolated(&self, wpos: Vec2<f32>) -> Weather
Get the weather at a given world position by doing bilinear interpolation between four cells.
sourcepub fn get_max_near(&self, wpos: Vec2<f32>) -> Weather
pub fn get_max_near(&self, wpos: Vec2<f32>) -> Weather
Get the max weather near a position
Trait Implementations§
source§impl Clone for WeatherGrid
impl Clone for WeatherGrid
source§fn clone(&self) -> WeatherGrid
fn clone(&self) -> WeatherGrid
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 Debug for WeatherGrid
impl Debug for WeatherGrid
source§fn from(value: &SharedWeatherGrid) -> Self
fn from(value: &SharedWeatherGrid) -> Self
Converts to this type from the input type.
source§fn from(value: &WeatherGrid) -> Self
fn from(value: &WeatherGrid) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for WeatherGrid
impl RefUnwindSafe for WeatherGrid
impl Send for WeatherGrid
impl Sync for WeatherGrid
impl Unpin for WeatherGrid
impl UnwindSafe for WeatherGrid
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more