pub struct InfiniteTileLayerData { /* private fields */ }Expand description
The raw data of a InfiniteTileLayer. Does not include a reference to its parent Map.
Implementations§
Source§impl InfiniteTileLayerData
impl InfiniteTileLayerData
Sourcepub fn get_tile_data(&self, x: i32, y: i32) -> Option<&LayerTileData>
pub fn get_tile_data(&self, x: i32, y: i32) -> Option<&LayerTileData>
Obtains the tile data present at the position given.
If the position given is invalid or the position is empty, this function will return None.
If you want to get a Tile instead, use InfiniteTileLayer::get_tile().
Sourcepub fn chunk_data(
&self,
) -> impl ExactSizeIterator<Item = ((i32, i32), &ChunkData)>
pub fn chunk_data( &self, ) -> impl ExactSizeIterator<Item = ((i32, i32), &ChunkData)>
Returns an iterator over only the data part of the chunks of this tile layer.
In 99.99% of cases you’ll want to use InfiniteTileLayer::chunks() instead; Using this method is only
needed if you only require the tile data of the chunks (and no other utilities provided by
the map-wrapped LayerTile), and you are in dire need for that extra bit of performance.
This iterator doesn’t have any particular order.
Sourcepub fn get_chunk_data(&self, x: i32, y: i32) -> Option<&ChunkData>
pub fn get_chunk_data(&self, x: i32, y: i32) -> Option<&ChunkData>
Obtains a chunk’s data by its position. To obtain the position of the chunk that contains a
tile, use ChunkData::tile_to_chunk_pos().
In 99.99% of cases you’ll want to use InfiniteTileLayer::get_chunk() instead; Using this method is only
needed if you only require the tile data of the chunk (and no other utilities provided by
the map-wrapped LayerTile), and you are in dire need for that extra bit of performance.
Trait Implementations§
Source§impl Clone for InfiniteTileLayerData
impl Clone for InfiniteTileLayerData
Source§fn clone(&self) -> InfiniteTileLayerData
fn clone(&self) -> InfiniteTileLayerData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more