pub(crate) fn update_chunk_hashmap_for_added_tiles(
    mut chunk_query: Query<&mut Chunk>,
    tile_query: Query<(Entity, &Tile, &MapVec2), Added<Tile>>,
) {
    for (tile_entity, new_tile, tile_pos) in tile_query.iter() {
        if let Ok(mut chunk) = chunk_query.get_mut(new_tile.chunk) {
            chunk.tiles.insert(*tile_pos, tile_entity);
        }
    }
}
// Adds new tiles to the chunk hash map.
Adds new tiles to the chunk hash map.
Adds new tiles to the chunk hash map .
pub(crate) fn update_chunk_hashmap_for_added_tiles(
    mut chunk_query: Query<&mut Chunk>,
    tile_query: Query<(Entity, &Tile, &MapVec2), Added<Tile>>,
) {
    for (tile_entity, new_tile, tile_pos) in tile_query.iter() {
        if let Ok(mut chunk) = chunk_query.get_mut(new_tile.chunk) {
            chunk.tiles.insert(*tile_pos, tile_entity);
        }
    }
}
pub ( crate ) fn update_chunk_hashmap_for_added_tiles ( mut chunk_query : Query < & mut Chunk > , tile_query : Query < ( Entity , & Tile , & MapVec2 ) , Added < Tile > > , ) { for ( tile_entity , new_tile , tile_pos ) in tile_query . iter ( ) { if let Ok ( mut chunk ) = chunk_query . get_mut ( new_tile . chunk ) { chunk . tiles . insert ( * tile_pos , tile_entity ) ; } } }
Adds new tiles to the chunk hash map.
Adds new tiles to the chunk hash map .
chunk_query
Query<&mut Chunk>
tile_query
Query<(Entity, &Tile, &MapVec2), Added<Tile>>
chunk_query
Query<&mut Chunk>
tile_query
Query<(Entity, &Tile, &MapVec2), Added<Tile>>