use bevy::prelude::*;

use crate::resources::AppState;

use super::load::Load;

#[derive(Clone, Copy, Debug)]
pub struct LoadPlugin;

impl Plugin for LoadPlugin {

    fn build(&self, app: &mut App) {
        app
            .add_systems(
                OnEnter(AppState::Load),
                Load::init,
            )
            .add_systems(
                Last,
                Load::finished_loading.run_if(in_state(AppState::Load)),
            )
        ;
    }
}
