DCES

DCES is a library that provides a variant of the Entity Component System: https://en.wikipedia.org/wiki/Entity–component–system.

The goal of DCES is a lightweight ECS library with zero dependencies used by UI frameworks and game engines. It is being developed as part of OrbTk an (G)UI framework written in Rust. All widgets and properties of OrbTk are handled by DCES.

Build status MIT licensed crates.io docs.rs

Features:

Usage

To include DCES in your project, just add the dependency line to your Cargo.toml file:

text dces = "0.1.6"

To use DCES master, just add the dependency line to your Cargo.toml file:

text dces = { git = https://gitlab.redox-os.org/redox-os/dces-rust.git }

Example

```rust use dces::prelude::*;

struct Name { value: String }

struct PrintSystem;

impl System for PrintSystem { fn run(&self, entities: &VecEntityContainer, ecm: &mut EntityComponentManager) { for entity in &entities.inner { if let Ok(comp) = ecm.borrow_component::(*entity) { println!("{}", comp.value); } } } }

fn main() { let mut world = World::::new();

world.create_entity().with(Name { value: String::from("DCES") }).build();
world.create_system(PrintSystem).build();

world.run();

} ```

You could find additional examples in the examples/ directory.

You can start the basic example by executing the following command:

text cargo run --example basic

Build and run documenation

You can build and run the latest documentation by executing the following command:

text cargo doc --no-deps --open

Future features

Inspirations

FAQ

Why not Specs

Because DCES is developed to fulfill the requirements of OrbTk. To reduce the dependency tree of OrbTk DCES depends on zero crates.