#![allow(clippy::too_many_arguments, clippy::type_complexity)]
#![warn(missing_docs)]
pub mod animation;
mod button;
mod camera;
pub mod cursor;
pub mod filter;
mod image;
#[cfg(feature = "line")]
mod line;
mod map;
pub mod math;
pub mod palette;
#[cfg(feature = "particle")]
mod particle;
mod pixel;
pub mod position;
pub mod prelude;
pub mod screen;
pub mod set;
pub mod sprite;
mod text;
mod ui;
use std::{marker::PhantomData, path::PathBuf};
use position::PxLayer;
use prelude::*;
#[derive(Debug)]
pub struct PxPlugin<L: PxLayer> {
screen_size: ScreenSize,
palette_path: PathBuf,
_l: PhantomData<L>,
}
impl<L: PxLayer> PxPlugin<L> {
pub fn new(screen_size: impl Into<ScreenSize>, palette_path: impl Into<PathBuf>) -> Self {
Self {
screen_size: screen_size.into(),
palette_path: palette_path.into(),
_l: PhantomData,
}
}
}
impl<L: PxLayer> Plugin for PxPlugin<L> {
fn build(&self, app: &mut App) {
app.add_plugins((
animation::plug,
button::plug,
camera::plug,
cursor::plug,
filter::plug::<L>,
#[cfg(feature = "line")]
line::plug::<L>,
map::plug::<L>,
palette::plug(self.palette_path.clone()),
position::plug::<L>,
screen::Plug::<L>::new(self.screen_size),
sprite::plug::<L>,
text::plug::<L>,
#[cfg(feature = "particle")]
(RngPlugin::default(), particle::plug::<L>),
));
}
}