pub fn notify_chunk_for_tile<M: Into<u16>, L: Into<u16>>(
        &mut self,
        tile_pos: TilePos,
        map_id: M,
        layer_id: L,
    ) {
        let map_id = map_id.into();
        let layer_id = layer_id.into();
        if let Some((_, map)) = self
            .map_query_set
            .q1()
            .iter()
            .find(|(_, map)| map.id == map_id)
        {
            if let Some(layer_entity) = map.get_layer_entity(layer_id) {
                if let Ok((_, layer)) = self.layer_query_set.q1().get(*layer_entity) {
                    let chunk_pos = ChunkPos(
                        tile_pos.0 / layer.settings.chunk_size.0,
                        tile_pos.1 / layer.settings.chunk_size.1,
                    );
                    if let Some(chunk_entity) = layer.get_chunk(chunk_pos) {
                        if let Ok((_, mut chunk)) = self.chunk_query_set.q0().get_mut(chunk_entity)
                        {
                            chunk.needs_remesh = true;
                        }
                    }
                }
            }
        }
    }
/// Let's the internal systems know to remesh the chunk for a given tile pos and layer_id.
Let's the internal systems know to remesh the chunk for a given tile pos and layer_id.
Let ' s the internal systems know to remesh the chunk for a given tile pos and layer_id .
pub fn notify_chunk_for_tile<M: Into<u16>, L: Into<u16>>(
        &mut self,
        tile_pos: TilePos,
        map_id: M,
        layer_id: L,
    ) {
        let map_id = map_id.into();
        let layer_id = layer_id.into();
        if let Some((_, map)) = self
            .map_query_set
            .q1()
            .iter()
            .find(|(_, map)| map.id == map_id)
        {
            if let Some(layer_entity) = map.get_layer_entity(layer_id) {
                if let Ok((_, layer)) = self.layer_query_set.q1().get(*layer_entity) {
                    let chunk_pos = ChunkPos(
                        tile_pos.0 / layer.settings.chunk_size.0,
                        tile_pos.1 / layer.settings.chunk_size.1,
                    );
                    if let Some(chunk_entity) = layer.get_chunk(chunk_pos) {
                        if let Ok((_, mut chunk)) = self.chunk_query_set.q0().get_mut(chunk_entity)
                        {
                            chunk.needs_remesh = true;
                        }
                    }
                }
            }
        }
    }
pub fn notify_chunk_for_tile < M : Into < u16 > , L : Into < u16 > > ( & mut self , tile_pos : TilePos , map_id : M , layer_id : L , ) { let map_id = map_id . into ( ) ; let layer_id = layer_id . into ( ) ; if let Some ( ( _ , map ) ) = self . map_query_set . q1 ( ) . iter ( ) . find ( | ( _ , map ) | map . id == map_id ) { if let Some ( layer_entity ) = map . get_layer_entity ( layer_id ) { if let Ok ( ( _ , layer ) ) = self . layer_query_set . q1 ( ) . get ( * layer_entity ) { let chunk_pos = ChunkPos ( tile_pos . 0 / layer . settings . chunk_size . 0 , tile_pos . 1 / layer . settings . chunk_size . 1 , ) ; if let Some ( chunk_entity ) = layer . get_chunk ( chunk_pos ) { if let Ok ( ( _ , mut chunk ) ) = self . chunk_query_set . q0 ( ) . get_mut ( chunk_entity ) { chunk . needs_remesh = true ; } } } } } }
Let's the internal systems know to remesh the chunk for a given tile pos and layer_id.
Let ' s the internal systems know to remesh the chunk for a given tile pos and layer_id .
&mut self
tile_pos
TilePos
map_id
M
layer_id
L
&mut self
tile_pos
TilePos
map_id
M
layer_id
L