Shipyard is an Entity Component System. While it's usable it is far from finished.
World
will do the rest.```rust use shipyard::*;
struct Health(f32); struct Position { x: f32, y: f32 };
fn run(pos: &Position, health: &mut Health) { for (pos, health) in (pos, health).iter() { if isinacid(pos) { health.0 -= 1.0; } } }
fn isinacid(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.addworkload("In acid", InAcid); world.rundefault(); ```
Licensed under either of
at your option.
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.