#![cfg_attr(feature = "document-features", doc = "## Features")]
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
#![warn(missing_docs)]
#![cfg_attr(doc, allow(unknown_lints))]
#![deny(rustdoc::all)]
#[doc(inline)]
pub use bones_lib as lib;
#[doc(inline)]
pub use bones_asset as asset;
#[doc(inline)]
pub use glam;
pub mod prelude {
pub use crate::{
animation::*, input::prelude::*, params::*, render::prelude::*, storage::*, time::*,
utils::*, AssetServerExt, DefaultGamePlugin, DefaultSessionPlugin, ExitBones,
};
pub use futures_lite::future::Boxed as BoxedFuture;
#[cfg(feature = "ui")]
pub use crate::debug;
#[cfg(not(target_arch = "wasm32"))]
pub use crate::networking::prelude::*;
pub use bones_asset::anyhow::Context;
pub use bones_asset::prelude::*;
pub use bones_lib::prelude::*;
pub use glam::*;
pub use serde::{Deserialize, Serialize};
#[cfg(feature = "scripting")]
pub use bones_scripting::prelude::*;
#[cfg(feature = "localization")]
pub use crate::localization::*;
#[cfg(feature = "logging")]
pub use crate::logging::prelude::*;
}
pub mod animation;
pub mod input;
pub mod params;
pub mod render;
pub mod storage;
pub mod time;
pub mod utils;
#[cfg(feature = "audio")]
pub mod audio;
#[cfg(feature = "ui")]
pub mod debug;
#[cfg(not(target_arch = "wasm32"))]
pub mod networking;
#[cfg(feature = "scripting")]
pub use bones_scripting as scripting;
#[cfg(feature = "localization")]
pub mod localization;
#[cfg(feature = "logging")]
pub mod logging;
#[cfg(doc)]
pub mod external {
#[doc(inline)]
pub use ggrs;
#[doc(inline)]
pub use bones_matchmaker_proto;
}
pub struct DefaultSessionPlugin;
impl lib::SessionPlugin for DefaultSessionPlugin {
fn install(self, session: &mut lib::Session) {
session
.install_plugin(animation::animation_plugin)
.install_plugin(render::render_plugin);
}
}
pub struct DefaultGamePlugin;
impl lib::GamePlugin for DefaultGamePlugin {
#[allow(unused_variables)]
fn install(self, game: &mut lib::Game) {
#[cfg(feature = "audio")]
game.install_plugin(audio::game_plugin);
#[cfg(feature = "scripting")]
game.install_plugin(bones_scripting::ScriptingGamePlugin::default());
}
}
pub trait AssetServerExt {
fn register_default_assets(self) -> Self;
}
impl AssetServerExt for &mut bones_asset::AssetServer {
fn register_default_assets(self) -> Self {
use crate::prelude::*;
Image::register_schema();
Atlas::register_schema();
#[cfg(feature = "localization")]
{
LocalizationAsset::register_schema();
FluentBundleAsset::register_schema();
FluentResourceAsset::register_schema();
}
#[cfg(feature = "ui")]
Font::register_schema();
self
}
}
#[derive(bones_schema::HasSchema, Default, Clone)]
pub struct ExitBones(pub bool);
impl std::ops::Deref for ExitBones {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for ExitBones {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}