use bevy_ecs::prelude::*;

#[derive(Component, Clone, Copy, Default)]
pub struct Position {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}

#[derive(Component, Clone, Copy, Default)]
pub struct Rotation {
    pub pitch: f32,
    pub yaw: f32,
}

#[derive(Component, Clone, Copy, Default)]
pub struct Velocity {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}

#[derive(Component, Clone, Copy)]
pub struct Health {
    pub current: f32,
    pub max: f32,
}

impl Health {
    pub fn new(max: f32) -> Self {
        Self { current: max, max }
    }
}

impl Default for Health {
    fn default() -> Self {
        Self::new(100.0)
    }
}

#[derive(Component, Clone, Copy, Default)]
pub struct Player;

#[derive(Component, Clone, Copy)]
pub struct TypeId(pub u16);
