sardonyx 0.0.3

Home automation platform, based on the Amethyst game engine
Documentation
//! sardonyx is a free and open source game engine written in idiomatic
//! [Rust][rs] for building video games and interactive multimedia applications.
//! The source code is available for download on [GitHub][gh]. See the
//! [online book][bk] for a complete guide to using sardonyx.
//!
//! [rs]: https://www.rust-lang.org/
//! [gh]: https://github.com/sardonyx/sardonyx
//! [bk]: https://book.sardonyx.rs/master/
//!
//! This project is a work in progress and is very incomplete. Pardon the dust!
//!
//! # Example
//!
//! ```rust,no_run
//! use sardonyx::prelude::*;
//! use sardonyx::winit::{Event, KeyboardInput, VirtualKeyCode, WindowEvent};
//!
//! struct GameState;
//!
//! impl SimpleState for GameState {
//!     fn on_start(&mut self, _: StateData<'_, GameData<'_, '_>>) {
//!         println!("Starting game!");
//!     }
//!
//!     fn handle_event(&mut self, _: StateData<'_, GameData<'_, '_>>, event: StateEvent) -> SimpleTrans {
//!         if let StateEvent::Window(event) = &event {
//!             match event {
//!                  Event::WindowEvent { event, .. } => match event {
//!                     WindowEvent::KeyboardInput {
//!                         input: KeyboardInput { virtual_keycode: Some(VirtualKeyCode::Escape), .. }, ..
//!                     } |
//!                     WindowEvent::CloseRequested => Trans::Quit,
//!                     _ => Trans::None,
//!                 },
//!                 _ => Trans::None,
//!             }
//!         } else {
//!             Trans::None
//!         }
//!     }
//!
//!     fn update(&mut self, _: &mut StateData<'_, GameData<'_, '_>>) -> SimpleTrans {
//!         println!("Computing some more whoop-ass...");
//!         Trans::Quit
//!     }
//! }
//!
//! fn main() -> sardonyx::Result<()> {
//!     let assets_dir = "assets/";
//!     let mut game = Application::new(assets_dir, GameState, GameDataBuilder::default())?;
//!     game.run();
//!     Ok(())
//! }
//! ```

#![doc(html_logo_url = "https://sardonyx.rs/brand/logo-standard.svg")]
#![warn(
    missing_debug_implementations,
    missing_docs,
    rust_2018_idioms,
    rust_2018_compatibility
)]
#![warn(clippy::all)]
#![allow(clippy::new_without_default)]

#[cfg(feature = "animation")]
pub use sardonyx_animation as animation;
pub use sardonyx_assets as assets;
#[cfg(feature = "audio")]
pub use sardonyx_audio as audio;
pub use sardonyx_config as config;
pub use sardonyx_controls as controls;
pub use sardonyx_core as core;
pub use sardonyx_derive as derive;
pub use sardonyx_error as error;
#[cfg(feature = "gltf")]
pub use sardonyx_gltf as gltf;
pub use sardonyx_input as input;
#[cfg(feature = "locale")]
pub use sardonyx_locale as locale;
#[cfg(feature = "network")]
pub use sardonyx_network as network;
pub use sardonyx_rendy as renderer;
pub use sardonyx_ui as ui;
pub use sardonyx_utils as utils;
pub use sardonyx_window as window;
pub use winit;

pub use crate::core::{ecs, shred, shrev};
#[doc(hidden)]
pub use crate::derive::*;

pub use self::{
    app::{Application, ApplicationBuilder, CoreApplication},
    callback_queue::{Callback, CallbackQueue},
    error::Error,
    game_data::{DataDispose, DataInit, GameData, GameDataBuilder},
    logger::{start_logger, LevelFilter as LogLevelFilter, Logger, LoggerConfig, StdoutLog},
    state::{
        EmptyState, EmptyTrans, SimpleState, SimpleTrans, State, StateData, StateMachine, Trans,
        TransEvent,
    },
    state_event::{StateEvent, StateEventReader},
};

/// Convenience alias for use in main functions that uses sardonyx.
pub type Result<T> = std::result::Result<T, error::Error>;

pub mod prelude;

mod app;
mod callback_queue;
mod game_data;
mod logger;
mod state;
mod state_event;