mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 20:35:02 +01:00
more
This commit is contained in:
parent
4c53037082
commit
0bae67e931
2 changed files with 12 additions and 16 deletions
14
src/tiles.rs
14
src/tiles.rs
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
tiles.rs
14
tiles.rs
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue