1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#![crate_name = "dces"] #![crate_type = "lib"] #![deny(warnings)] //! # DCES //! //! DCES is a library that provides a variant of the entity component system. //! //! Features: //! //! * Filter and sort entities for systems //! * Define priorities (run order) for systems //! //! **The library is still WIP. API changes are possible.** //! //! [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) //! //! # Example //! //! ```no_run //! use dces::prelude::*; //! //! #[derive(Default)] //! struct Name { //! value: String, //! } //! //! struct PrintSystem; //! //! impl System<EntityStore, ComponentStore, PhantomContext> for PrintSystem { //! fn run(&self, ecm: &mut EntityComponentManager<EntityStore, ComponentStore>) { //! let (e_store, c_store) = ecm.stores(); //! //! for entity in &e_store.inner { //! if let Ok(comp) = c_store.get::<Name>(*entity) { //! println!("{}", comp.value); //! } //! } //! } //! } //! //! //! let mut world = World::from_stores(EntityStore::default(), ComponentStore::default()); //! //! world //! .create_entity() //! .components( //! ComponentBuilder::new() //! .with(Name { //! value: String::from("DCES"), //! }) //! .build(), //! ) //! .build(); //! //! world.create_system(PrintSystem).build(); //! world.run(); //! //! //! ``` pub mod component; pub mod entity; pub mod error; pub mod prelude; pub mod system; pub mod world;