use bevy::{ ecs::{system::RunSystemOnce, world::Command}, prelude::*, }; use super::{ events::RecreateMazeEvent, systems::{self, recreation::handle_maze_recreation_event}, MazeConfig, MazePluginLoaded, }; #[derive(Default)] pub(crate) struct MazePlugin; impl Plugin for MazePlugin { fn build(&self, app: &mut App) { app.init_resource::() .add_event::() .add_systems(Update, handle_maze_recreation_event); } } impl Command for MazePlugin { fn apply(self, world: &mut World) { world.insert_resource(MazePluginLoaded); world.run_system_once(systems::setup::setup); } }