Skip to content

Commit

Permalink
Merge pull request miguelmartin75#89 from Aljenci/master
Browse files Browse the repository at this point in the history
Add example of anax::Excludes in System creation in Readme
  • Loading branch information
miguelmartin75 authored Nov 11, 2020
2 parents 11d310c + 9c3e7d9 commit 3465d52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ auto pos = entity.getComponent<PositionComponent>();
A System is used to contain on entities with specific components (require or exclude a set of component types). It is typically used to update, render or perform some logic these entities.

```c++
struct MovementSystem : anax::System<anax::Requires<PositionComponent, VelocityComponent>>
struct MovementSystem : anax::System<anax::Requires<PositionComponent, VelocityComponent>, anax::Excludes<ParalizedComponent>>
{
// ...
};
```

That is, a movement system requires entities with a `PositionComponent` and `VelocityComponent`. You may determine if an entity is removed/added to the system via these two override-able (virtual) methods:
That is, a movement system requires entities with a `PositionComponent` and `VelocityComponent`, also excludes entities with a `ParalizedComponent`. You may determine if an entity is removed/added to the system via these two override-able (virtual) methods:

- `onEntityAdded(Entity&)`
- `onEntityRemoved(Entity&)`
Expand Down

0 comments on commit 3465d52

Please sign in to comment.