use bevy::{color::palettes::css, math::UVec3, prelude::{Color, Component}, reflect::Reflect, transform::components::Transform};
use crate::debug::MapType;
#[derive(Component, Default, Debug, Clone, Eq, PartialEq, Hash)]
pub struct Position(pub UVec3);
#[derive(Component, Default, Debug)]
pub struct Pathfind {
pub goal: UVec3,
pub use_astar: bool,
}
#[derive(Component, Default, Debug)]
pub struct Next(pub UVec3);
#[derive(Component, Default)]
pub struct Blocking;
#[derive(Component, Default, Debug)]
pub struct AvoidanceFailed;
#[derive(Component, Default, Debug)]
pub struct RerouteFailed;
#[derive(Component)]
pub struct DebugPath {
pub tile_width: u32,
pub tile_height: u32,
pub map_type: MapType,
pub color: Color,
pub draw_unrefined: bool,
}
impl Default for DebugPath {
fn default() -> Self {
DebugPath {
tile_width: 16,
tile_height: 16,
map_type: MapType::Square,
color: bevy::prelude::Color::Srgba(css::RED),
draw_unrefined: false,
}
}
}
#[derive(Component, Default)]
pub struct DebugColor(pub Color);
#[derive(Reflect, Component)]
#[require(Transform)]
pub struct DebugMap {
pub tile_width: u32,
pub tile_height: u32,
pub map_type: MapType,
pub draw_chunks: bool,
pub draw_points: bool,
pub draw_entrances: bool,
pub draw_cached_paths: bool,
}
impl Default for DebugMap {
fn default() -> Self {
DebugMap {
tile_width: 16,
tile_height: 16,
map_type: MapType::Square,
draw_chunks: true,
draw_points: false,
draw_entrances: false,
draw_cached_paths: false,
}
}
}