pub fn update<F, T>(&mut self, point: Vec2, updater: F) -> T
    where
        F: FnOnce(&mut Tile) -> T,
    {
        let index = self
            .buffer
            .make_index(point)
            .unwrap_or_else(|| out_of_bounds(point, self.buffer.size()));
        let ret = updater(&mut self.buffer.curr[index]);
        if self.buffer.old[index] != self.buffer.curr[index] {
            self.buffer.changed.insert(point);
        } else {
            self.buffer.changed.remove(&point);
        }
        ret
    }
/// Applies an update function to a [`Tile`]. An update function gets access
/// to a mutable reference of a [`Tile`], updates it, and then the screen
/// handles any changes made to it. This operation is buffered.
Applies an update function to a [`Tile`]. An update function gets access
to a mutable reference of a [`Tile`], updates it, and then the screen
handles any changes made to it. This operation is buffered.
Applies an update function to a [ ` Tile ` ] . An update function gets access to a mutable reference of a [ ` Tile ` ] updates it and then the screen handles any changes made to it . This operation is buffered .
pub fn update<F, T>(&mut self, point: Vec2, updater: F) -> T
    where
        F: FnOnce(&mut Tile) -> T,
    {
        let index = self
            .buffer
            .make_index(point)
            .unwrap_or_else(|| out_of_bounds(point, self.buffer.size()));
        let ret = updater(&mut self.buffer.curr[index]);
        if self.buffer.old[index] != self.buffer.curr[index] {
            self.buffer.changed.insert(point);
        } else {
            self.buffer.changed.remove(&point);
        }
        ret
    }
pub fn update < F , T > ( & mut self , point : Vec2 , updater : F ) -> T where F : FnOnce ( & mut Tile ) -> T , { let index = self . buffer . make_index ( point ) . unwrap_or_else ( | | out_of_bounds ( point , self . buffer . size ( ) ) ) ; let ret = updater ( & mut self . buffer . curr [ index ] ) ; if self . buffer . old [ index ] != self . buffer . curr [ index ] { self . buffer . changed . insert ( point ) ; } else { self . buffer . changed . remove ( & point ) ; } ret }
Applies an update function to a [`Tile`].
Applies an update function to a [ ` Tile ` ] .
&mut self
point
Vec2
updater
F
&mut self
point
Vec2
updater
F