pub mod agent;
#[cfg(feature = "assets")]
pub mod assets;
pub mod bus;
pub mod checkpoint;
pub mod policy;
pub mod prelude;
pub mod reflect;
pub mod systems;
#[derive(Debug, Clone, Default)]
pub struct RigPlugin {
pub bus: bus::BusPlugin,
}
impl RigPlugin {
pub fn with_policy(policy: rig_core::serve::ServingPolicy) -> Self {
Self {
bus: bus::BusPlugin::with_policy(policy),
}
}
#[must_use = "the setting applies to the returned value"]
pub fn ambiguity_detection(mut self, level: bevy_ecs::schedule::LogLevel) -> Self {
self.bus = self.bus.ambiguity_detection(level);
self
}
}
impl bevy_app::Plugin for RigPlugin {
fn build(&self, app: &mut bevy_app::App) {
if !app.is_plugin_added::<bevy_time::TimePlugin>() {
app.add_plugins(bevy_time::TimePlugin);
}
if !app.is_plugin_added::<bevy_diagnostic::DiagnosticsPlugin>() {
app.add_plugins(bevy_diagnostic::DiagnosticsPlugin);
}
app.add_plugins((self.bus.clone(), systems::AgentPlugin));
checkpoint::register_types(app.world_mut());
}
}