mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 11:45:01 +01:00
more
This commit is contained in:
parent
ed51ba2b9c
commit
c5a1baba26
2 changed files with 2 additions and 56 deletions
28
src/tiles.rs
28
src/tiles.rs
|
|
@ -1,10 +1,8 @@
|
||||||
use std::{fmt::Debug, marker::PhantomData, ops::Index};
|
use std::{fmt::Debug, marker::PhantomData};
|
||||||
|
|
||||||
use egui_inspect::{derive::Inspect, Inspect};
|
use egui_inspect::{derive::Inspect, Inspect};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{math::TILE_SIZE, texture_atlas::RectMap};
|
|
||||||
|
|
||||||
#[derive(Inspect, PartialEq, Eq)]
|
#[derive(Inspect, PartialEq, Eq)]
|
||||||
pub struct TileId<Layer>(pub u16, PhantomData<Layer>);
|
pub struct TileId<Layer>(pub u16, PhantomData<Layer>);
|
||||||
|
|
||||||
|
|
@ -20,13 +18,6 @@ impl<Layer> Debug for TileId<Layer> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Layer> TileId<Layer> {
|
|
||||||
pub fn empty(&self) -> bool {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
pub const EMPTY: Self = Self(0, PhantomData);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Bg {}
|
pub enum Bg {}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -34,23 +25,6 @@ pub enum Mid {}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Fg {}
|
pub enum Fg {}
|
||||||
|
|
||||||
impl Bg {
|
|
||||||
pub fn unknown_def() -> TileDef<Self> {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Mid {
|
|
||||||
pub fn unknown_def() -> TileDef<Self> {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Fg {
|
|
||||||
pub fn unknown_def() -> TileDef<Self> {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait TileLayer {
|
pub trait TileLayer {
|
||||||
/// Definitions specific to this layer
|
/// Definitions specific to this layer
|
||||||
|
|
|
||||||
30
tiles.rs
30
tiles.rs
|
|
@ -1,10 +1,8 @@
|
||||||
use std::{fmt::Debug, marker::PhantomData, ops::Index};
|
use std::{fmt::Debug, marker::PhantomData};
|
||||||
|
|
||||||
use egui_inspect::{derive::Inspect, Inspect};
|
use egui_inspect::{derive::Inspect, Inspect};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{math::TILE_SIZE, texture_atlas::RectMap};
|
|
||||||
|
|
||||||
#[derive(Inspect, PartialEq, Eq)]
|
#[derive(Inspect, PartialEq, Eq)]
|
||||||
pub struct TileId<Layer>(pub u16, PhantomData<Layer>);
|
pub struct TileId<Layer>(pub u16, PhantomData<Layer>);
|
||||||
|
|
||||||
|
|
@ -20,13 +18,6 @@ impl<Layer> Debug for TileId<Layer> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Layer> TileId<Layer> {
|
|
||||||
pub fn empty(&self) -> bool {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
pub const EMPTY: Self = Self(0, PhantomData);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Bg {}
|
pub enum Bg {}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -34,24 +25,6 @@ pub enum Mid {}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Fg {}
|
pub enum Fg {}
|
||||||
|
|
||||||
impl Bg {
|
|
||||||
pub fn unknown_def() -> TileDef<Self> {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Mid {
|
|
||||||
pub fn unknown_def() -> TileDef<Self> {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Fg {
|
|
||||||
pub fn unknown_def() -> TileDef<Self> {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait TileLayer {
|
pub trait TileLayer {
|
||||||
/// Definitions specific to this layer
|
/// Definitions specific to this layer
|
||||||
type SpecificDef;
|
type SpecificDef;
|
||||||
|
|
@ -127,7 +100,6 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Inspect, Clone, Copy)]
|
#[derive(Serialize, Deserialize, Debug, Inspect, Clone, Copy)]
|
||||||
pub struct TileBb {
|
pub struct TileBb {
|
||||||
pub x: u8,
|
pub x: u8,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue