use bevy::prelude::*;

pub mod components;
pub mod input;
pub mod kinematic;
pub mod orbit;

pub struct MovementPlugin;

impl Plugin for MovementPlugin {
    fn build(&self, app: &mut App) {
        // No state gating for slice 1: systems are no-ops when no Player exists.
        // When AppState::InGame is wired up, gate these on `in_state(AppState::InGame)`
        // and consider moving them to FixedUpdate for SpacetimeDB determinism.
        app.add_systems(
            Update,
            (
                input::click_to_move,
                kinematic::steer_to_target,
                kinematic::integrate_velocity,
                orbit::update_orbits,
            )
                .chain(),
        );
    }
}
