-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Engine Architecture Guides #9
Comments
Rust hurting my brain // https://www.reddit.com/r/rust/comments/tdrrop/which_heterogenous_list_generic_tuple_library/
fn test() {
let query = (H, (H, Null));
let nully = query.gib();
let e = query.0;
}
trait HList {
type Output;
// Define whatever fns you need here.
// In my experience you usually want to operate on all values of your HList recursively.
fn gib(&self) -> Self::Output;
}
// This is your "base case", an empty HList.
struct Null;
impl HList for Null {
type Output = ();
// Implement your fns with a simple base case implementation.
fn gib(&self) -> Self::Output {
()
}
}
// This is the "recursive case", defining variable length lists.
impl<H, T> HList for (H, T)
where
T: HList,
H: Cat,
{
type Output = (H::Output, T::Output);
// Implement your fns, often calling the same fn on `T`.
// This allows you to recursively operate on your list.
fn gib(&self) -> Self::Output {
(self.0.gib_value(), self.1.gib())
}
}
struct H;
impl Cat for H {
type Output = i32;
fn gib_value(&self) -> Self::Output {
1
}
}
trait Cat {
type Output;
fn gib_value(&self) -> Self::Output;
} |
Scene graphs Features
Actor graphs
Out of scope/no use-case
See here for an API example https://github.com/bevyengine/bevy/blob/main/examples/scene/scene.rs And see here for how a popular game engine does it https://docs.godotengine.org/en/stable/getting_started/step_by_step/nodes_and_scenes.html |
Rust Engine + Game: |
ECS is nice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://bevy-cheatbook.github.io/introduction.html
The text was updated successfully, but these errors were encountered: