forked from skypjack/entt
-
Notifications
You must be signed in to change notification settings - Fork 0
Component
Alan Jefferson edited this page Oct 13, 2019
·
1 revision
Components represent the data in your application.
A tag is an empty component. You can use it as a boolean for an entity or series of components.
// Given a number of entities..
std::vector<entt::entity> vec(10);
registry.create<Position>(vec.begin(), vec.end());
// ..tag the first entity..
registry.assign<entt::tag<"first"_hs>>(vec[0]);
// ..and then loop over all entites with a given tag
registry.view<Position, entt::tag<"first"_hs>>().each([]() {
printf("I'll only iterate on positions that have a 'first' tag\n");
});
EnTT - Fast and Reliable ECS (Entity Component System)
Table of contents
Examples
Blog
- RAII
- Polymorphism
- Shared Components
- Intent System
- Input Handling
- Undo
- Operator Stack
- State
- Resources
- Interpolation
Resources
Extras