diff options
author | Alec Thomas <alec@swapoff.org> | 2013-10-04 10:48:13 -0400 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2013-10-04 10:48:13 -0400 |
commit | 21ba97c1b7df9909bffa36b573fb3451338cdf10 (patch) | |
tree | 285de6a4b1465d3e3fa455e7349e577f618ac909 | |
parent | 58e21af84d7f82f0153c946275ceb607097e3c5c (diff) |
Document dependency helper.
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -127,6 +127,18 @@ if (position) { } ``` +#### Component dependencies + +In the case where a component has dependencies on other components, a helper class exists that will automatically create these dependencies. + +eg. The following will also add `Position` and `Direction` components when a `Physics` component is added to an entity. + +```c++ +#include "entityx/deps/Dependency.h" + +system_manager->add<entityx::deps::Depdendency<Physics, Position, Direction>>(); +``` + #### Implementation notes - Components must provide a no-argument constructor. |