use nanoserde::DeJson;
pub mod layer;
#[derive(Clone, Debug, Default, DeJson)]
pub struct Grid {
pub width: i32,
pub height: i32,
}
#[derive(Clone, Debug, Default, DeJson)]
pub struct Property {
pub name: String,
pub value: String,
#[nserde(rename = "type")]
pub ty: String,
}
#[derive(Clone, Debug, Default, DeJson)]
pub struct Layer {}
#[derive(Clone, Debug, Default, DeJson)]
pub struct Frame {
duration: i32,
tileid: i32,
}
#[derive(Clone, Debug, Default, DeJson)]
#[nserde(default)]
pub struct Tile {
pub animation: Vec<Frame>,
pub id: usize,
pub image: Option<String>,
pub imagewidth: i32,
pub imageheight: i32,
pub objectgroup: Option<Layer>,
pub properties: Vec<Property>,
pub terrain: Vec<i32>,
#[nserde(rename = "type")]
pub ty: Option<String>,
}
#[derive(Clone, Debug, Default, DeJson)]
pub struct Tileoffset {
pub x: i32,
pub y: i32,
}
#[derive(Clone, Debug, Default, DeJson)]
pub struct Terrain {
pub name: String,
pub tile: i32,
}
#[derive(Clone, Debug, Default, DeJson)]
#[nserde(default)]
pub struct Tileset {
pub columns: i32,
pub firstgid: u32,
pub grid: Option<Grid>,
pub image: String,
pub imagewidth: i32,
pub imageheight: i32,
pub margin: i32,
pub name: String,
pub properties: Vec<Property>,
pub spacing: i32,
pub terrains: Option<Vec<Terrain>>,
pub tilecount: u32,
pub tileheight: i32,
pub tileoffset: Option<Tileoffset>,
#[nserde(default)]
pub tiles: Vec<Tile>,
pub tilewidth: i32,
pub transparentcolor: Option<String>,
pub source: String,
}
#[derive(Clone, Debug, Default, DeJson)]
#[nserde(default)]
pub struct Map {
pub backgroundcolor: String,
pub height: u32,
pub properties: Vec<Property>,
pub orientation: String,
pub renderorder: String,
pub tileheight: u32,
pub tilewidth: u32,
pub layers: Vec<layer::Layer>,
pub tilesets: Vec<Tileset>,
pub version: f32,
pub width: u32,
#[nserde(rename = "type")]
pub ty: String,
}