use std::hash::Hash;
use bevy::{ecs::entity::MapEntities, math::UVec2, prelude::Entity, utils::HashMap};
use lettuces::cell::Cell;
use super::ChunkCell;
pub enum ChunkLayerType<T> {
Dense(Vec<Vec<T>>),
Sparse(HashMap<ChunkCell, T>),
}
pub trait ChunkLayer<TileData>: Hash + MapEntities {
type ChunkSettings: Send + Sync + Default + Clone + Copy + Hash;
fn into_chunk_cell(cell: Cell, chunk_settings: &Self::ChunkSettings) -> ChunkCell;
fn new(
layer_type: ChunkLayerType<TileData>,
chunk_dimensions: UVec2,
map_settings: &Self::ChunkSettings,
) -> Self;
fn get_chunk_dimensions(&self) -> UVec2;
fn get_tile_data_mut(&mut self, chunk_cell: ChunkCell) -> Option<&mut TileData>;
fn get_tile_data(&self, chunk_cell: ChunkCell) -> Option<&TileData>;
fn set_tile_data(&mut self, chunk_cell: ChunkCell, tile_data: TileData);
fn get_tile_entity(&self, chunk_cell: ChunkCell) -> Option<Entity>;
fn set_tile_entity(&mut self, chunk_cell: ChunkCell, entity: Entity);
}