Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940use crate::prelude::*;
#[derive(Component, Debug, Copy, Clone, Default)]pub struct Player;
#[derive(Component, Debug, Copy, Clone, Default)]pub struct Glyph { pub char: u8, pub foreground: Color, pub background: Color,}
#[derive(Component, Debug, Copy, Clone, Default)]#[require(Position, NeedsLayout, TileSize = TileSize::square(1.), Sprite)]pub struct MapTile;
#[derive(Component, Debug, Copy, Clone, Default)]pub struct NeedsLayout;
#[derive(Component, Debug, Copy, Clone, Default, Eq, PartialEq, Hash)]pub struct Position { pub x: i32, pub y: i32,}
#[derive(Component, Debug, Copy, Clone, Default)]pub struct TileSize { pub width: f32, pub height: f32,}
impl TileSize { pub fn square(size: f32) -> Self { Self { width: size, height: size, } }}