Skip to content
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

Notes of Entities #75

Open
skyne98 opened this issue Feb 17, 2023 · 0 comments
Open

Notes of Entities #75

skyne98 opened this issue Feb 17, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@skyne98
Copy link
Contributor

skyne98 commented Feb 17, 2023

Entity

Entity is a lightweight object that contains traits, gets selected by queries and gets processed by systems. An entity has to be associated with a specific Realm, but can be created and initialized before it is added to one.

An entity can have an optional parent. By itself, it doesn't do much, but systems can use it to infer certain behaviors, such as TransformTraits becoming relative when parent is set.

Trait

Traits are lightweight data objects, which serve as both a piece of data storage and/or a marker for behavior. They are "components" from the "Entity-Component-System".

Bundle

Bundle is an abstract class, that contains a static list of initializable traits. They can be used to add or remove a whole chunk of related traits at once, enabling a whole set of functionality at once. Traits themselves should automatically implement Bundles, so the user can pass a Trait as a single-trait bundle.

EntityComponent

EntityComponents are Flame components, that serve as a bridge between the ECS architecture of backbone and a component-tree architecture of Flame. Each EntityComponent includes an entity and automatically searching for the nearest Realm parent to register itself onMount. There are BaseEntityComponent and PositionEntityComponent are available as alternatives to Component and PositionComponent. Access entity via entity.

@skyne98 skyne98 added the enhancement New feature or request label Feb 17, 2023
@skyne98 skyne98 self-assigned this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant