This commit is contained in:
nora 2023-04-18 12:21:11 +02:00
parent 4c53037082
commit 0bae67e931
2 changed files with 12 additions and 16 deletions

View file

@ -43,12 +43,11 @@ impl TileLayer for Fg {
} }
#[derive(Serialize, Deserialize, Inspect)] #[derive(Serialize, Deserialize, Inspect)]
pub struct TileDef<Layer: TileLayer> pub struct TileDef
where where
Layer::SpecificDef: Debug + Inspect,
{ {
/// Whether the tile emits light, and the light source offset /// Whether the tile emits light, and the light source offset
pub layer: Layer::SpecificDef, pub layer: <Bg as TileLayer>::SpecificDef,
//ADD pub blend_graphic: String, //ADD pub blend_graphic: String,
} }
@ -60,18 +59,16 @@ pub struct MidDef {
pub bb: Option<TileBb>, pub bb: Option<TileBb>,
} }
impl<Layer: TileLayer> Debug for TileDef<Layer> impl Debug for TileDef
where where
Layer::SpecificDef: Debug + Inspect,
{ {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
loop {} loop {}
} }
} }
impl<Layer: TileLayer> Default for TileDef<Layer> impl Default for TileDef<>
where where
Layer::SpecificDef: Default + Debug + Inspect,
{ {
fn default() -> Self { fn default() -> Self {
loop {} loop {}
@ -86,7 +83,8 @@ pub struct TileBb {
pub h: u8, pub h: u8,
} }
// this is actually used
#[derive(Serialize, Deserialize, Debug, Inspect)] #[derive(Serialize, Deserialize, Debug, Inspect)]
pub struct TileDb { pub struct TileDb {
unknown_bg: TileDef<Bg>, unknown_bg: TileDef,
} }

View file

@ -43,12 +43,11 @@ impl TileLayer for Fg {
} }
#[derive(Serialize, Deserialize, Inspect)] #[derive(Serialize, Deserialize, Inspect)]
pub struct TileDef<Layer: TileLayer> pub struct TileDef
where where
Layer::SpecificDef: Debug + Inspect,
{ {
/// Whether the tile emits light, and the light source offset /// Whether the tile emits light, and the light source offset
pub layer: Layer::SpecificDef, pub layer: <Bg as TileLayer>::SpecificDef,
//ADD pub blend_graphic: String, //ADD pub blend_graphic: String,
} }
@ -60,18 +59,16 @@ pub struct MidDef {
pub bb: Option<TileBb>, pub bb: Option<TileBb>,
} }
impl<Layer: TileLayer> Debug for TileDef<Layer> impl Debug for TileDef
where where
Layer::SpecificDef: Debug + Inspect,
{ {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
loop {} loop {}
} }
} }
impl<Layer: TileLayer> Default for TileDef<Layer> impl Default for TileDef<>
where where
Layer::SpecificDef: Default + Debug + Inspect,
{ {
fn default() -> Self { fn default() -> Self {
loop {} loop {}
@ -86,7 +83,8 @@ pub struct TileBb {
pub h: u8, pub h: u8,
} }
// this is actually used
#[derive(Serialize, Deserialize, Debug, Inspect)] #[derive(Serialize, Deserialize, Debug, Inspect)]
pub struct TileDb { pub struct TileDb {
unknown_bg: TileDef<Bg>, unknown_bg: TileDef,
} }