# `thallium_ecs`
[](https://crates.io/crates/thallium_ecs)
[](https://docs.rs/thallium_ecs)

A basic ECS that ive been working on
## Example code
```rust
use thallium_ecs::{
app::App,
entities::Entities,
query::{Component, Query, Ref, RefMut},
system_set::SystemSet,
};
struct Person {
name: String,
age: i32,
}
impl Component for Person {}
let mut app = App::new();
let person1 = app.create_entity();
app.add_component(person1, Person {
name: "Alice".into(),
age: 23,
});
let person2 = app.create_entity();
app.add_component(person2, Person {
name: "Bob".into(),
age: 25,
});
// create a system set that prints all people
let mut print_people = SystemSet::new();
}
});
// print out all the people
// should print:
//
// 'Alice' is 23 years old
// 'Bob' is 25 years old
app.run(&mut print_people);
// increment the ages of all people
}
});
// another way to increment the ages of all people would be
if let Some(person) = q.get_mut(entity) {
person.age += 1;
}
}
});
// print out all the people again
// should print:
//
// 'Alice' is 25 years old
// 'Bob' is 27 years old
app.run(&mut print_people);
```