use std::f32::consts::FRAC_PI_6;
use lettuces::{HexOrientation, OffsetHexMode, Quat};
use map_chunk_layer::HexChunkLayer;
use map_data::HexMapData;
use crate::{map::chunk::Chunk, tilemap_builder::TilemapBuilder, tilemap_manager::TilemapManager};
pub mod map_chunk_layer;
pub mod map_data;
pub type HexTilemapManager<'w, 's, TileData, MapLayers> =
TilemapManager<'w, 's, TileData, MapLayers, HexChunkLayer<TileData>, HexMapData>;
pub type HexChunk<TileData> = Chunk<HexChunkLayer<TileData>, TileData>;
pub type HexTilemapBuilder<TileData, MapLayers> =
TilemapBuilder<TileData, MapLayers, HexChunkLayer<TileData>, HexMapData>;
pub fn hex_offset_from_orientation(orientation: HexOrientation) -> OffsetHexMode {
match orientation {
HexOrientation::Pointy => OffsetHexMode::OddRows,
HexOrientation::Flat => OffsetHexMode::OddColumns,
}
}
pub fn hex_rotation(orientation: HexOrientation) -> Quat {
Quat::from_rotation_z(match orientation {
HexOrientation::Pointy => 0.0,
HexOrientation::Flat => FRAC_PI_6,
})
}