shipyard 0.2.0

Entity Component System
shipyard-0.2.0 doesn't have any documentation.

Shipyard

Shipyard is an Entity Component System. While it's usable it is far from finished.

LICENSE LICENSE Crates.io Documentation Gitter

Interesting features

  • Packing can enable perfect components alignment, allowing fast iteration but also SIMD instructions. To learn how it's done read Michele skypjack Caini's great blog article.
  • Automatic scheduling you just have to tell which systems you want to run and the World will do the rest.

Simple Exemple

use shipyard::*;

struct Health(f32);
struct Position { x: f32, y: f32 };

#[system(InAcid)]
fn run(pos: &Position, health: &mut Health) {
    for (pos, health) in (pos, health).iter() {
        if is_in_acid(pos) {
            health.0 -= 1.0;
        }
    }
}

fn is_in_acid(pos: &Position) -> bool {
    // well... it's wet season
     
    true
}

let world = World::default();

world.new_entity((Position { x: 0.0, y: 0.0 }, Health(1000.0)));

world.add_workload("In acid", InAcid);
world.run_default();

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.