// @generated by cargo bevy-api-gen collect, modify the templates not this file #![allow(clippy::all)] #![allow(unused, deprecated, dead_code)] #![cfg_attr(rustfmt, rustfmt_skip)] {% filter prettyplease %} {%- for crate in crates %} pub(crate) mod {{ crate.name }}; {% endfor -%} {% if args.self_is_bevy_script_api %} extern crate self as bevy_script_api; {% endif %} use bevy_mod_scripting_core::docs::DocFragment; pub struct {{ api_name }}; impl bevy_mod_scripting_core::hosts::APIProvider for {{ api_name }} { type APITarget = std::sync::Mutex; type ScriptContext = std::sync::Mutex; type DocTarget = bevy_mod_scripting_lua::docs::LuaDocFragment; fn attach_api(&mut self, ctx: &mut Self::APITarget) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { {% for crate in crates %} {% set crate_name = crate.name %} {{ crate_name }}::{{ "A P I Provider" | prefix(val=crate_name) | convert_case(case="upper_camel")}}.attach_api(ctx)?; {% endfor %} Ok(()) } fn get_doc_fragment(&self) -> Option { [ {% for crate in crates %} {% set crate_name = crate.name %} {{ crate_name }}::{{ "A P I Provider" | prefix(val=crate_name) | convert_case(case="upper_camel")}}.get_doc_fragment(), {% endfor %} ] .into_iter() .filter_map(|a: Option<_>| a) .fold(None, |a, b| match a { Some(a) => Some(a.merge(b)), None => Some(b), }) } fn setup_script( &mut self, script_data: &bevy_mod_scripting_core::hosts::ScriptData, ctx: &mut Self::ScriptContext, ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { Ok(()) } fn setup_script_runtime( &mut self, world_ptr: bevy_mod_scripting_core::world::WorldPointer, _script_data: &bevy_mod_scripting_core::hosts::ScriptData, ctx: &mut Self::ScriptContext, ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { Ok(()) } fn register_with_app(&self, app: &mut bevy::app::App) { {% for crate in crates %} {% set crate_name = crate.name %} {{ crate_name }}::{{ "A P I Provider" | prefix(val=crate_name) | convert_case(case="upper_camel")}}.register_with_app(app); {% endfor %} } } {% endfilter %}