use std::collections::{BTreeMap, HashMap};
use image::DynamicImage;
use poll_promise::Promise;

// type aliases to make the tile map less hellish
pub type ZoomLevel = usize;
pub type XCoord = usize;
pub type YCoord = usize;
pub type LayerId = u64;

#[derive(Default)]
pub struct LayerManager {
    pub layers: Vec<LayerId>,
    pub tiles: HashMap<(ZoomLevel, XCoord, YCoord, LayerId), Tile>,
}

pub trait LayerSource {
    const SOURCE_ID: u64;
}

pub struct Tile {
    pub promise: Promise<Result<DynamicImage, String>>
}