pub mod camera;
#[cfg(feature = "client")]
pub(crate) mod draw;
pub mod error;
mod game;
pub use game::*;
pub mod objects;
pub mod prelude;
#[cfg(feature = "client")]
pub mod resources;
#[cfg(feature = "client")]
pub(crate) mod utils;
pub use glam::{vec2, Vec2};
#[cfg(not(feature = "client"))]
mod check_feature_dependency {
#[cfg(feature = "egui")]
compile_error!("`egui` requires the `client` feature to be enabled.");
#[cfg(feature = "labels")]
compile_error!("`labels` requires the `client` feature to be enabled.");
#[cfg(feature = "audio")]
compile_error!("`audio` requires the `client` feature to be enabled.");
}
#[cfg(feature = "egui")]
pub use egui_winit_vulkano::egui;
use once_cell::sync::Lazy;
#[cfg(feature = "physics")]
pub use rapier2d::prelude::CoefficientCombineRule;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Direction {
Center,
N,
No,
O,
So,
S,
Sw,
W,
Nw,
}
#[cfg(feature = "labels")]
impl From<Direction> for (glyph_brush::HorizontalAlign, glyph_brush::VerticalAlign) {
fn from(value: Direction) -> Self {
use glyph_brush::{HorizontalAlign, VerticalAlign};
let horizontal = match value {
Direction::Center => HorizontalAlign::Center,
Direction::N => HorizontalAlign::Center,
Direction::No => HorizontalAlign::Right,
Direction::O => HorizontalAlign::Right,
Direction::So => HorizontalAlign::Right,
Direction::S => HorizontalAlign::Center,
Direction::Sw => HorizontalAlign::Left,
Direction::W => HorizontalAlign::Left,
Direction::Nw => HorizontalAlign::Left,
};
let vertical = match value {
Direction::Center => VerticalAlign::Center,
Direction::N => VerticalAlign::Top,
Direction::No => VerticalAlign::Top,
Direction::O => VerticalAlign::Center,
Direction::So => VerticalAlign::Bottom,
Direction::S => VerticalAlign::Bottom,
Direction::Sw => VerticalAlign::Bottom,
Direction::W => VerticalAlign::Center,
Direction::Nw => VerticalAlign::Top,
};
(horizontal, vertical)
}
}
pub static SCENE: Lazy<objects::scenes::Scene> = Lazy::new(objects::scenes::Scene::default);
pub static TIME: Lazy<Time> = Lazy::new(Time::default);
#[cfg(feature = "client")]
pub static INPUT: Lazy<input::Input> = Lazy::new(input::Input::new);
pub static SETTINGS: Lazy<game::settings::Settings> = Lazy::new(game::settings::Settings::new);