]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Document dependency helper.
authorAlec Thomas <alec@swapoff.org>
Fri, 4 Oct 2013 14:48:13 +0000 (10:48 -0400)
committerAlec Thomas <alec@swapoff.org>
Fri, 4 Oct 2013 14:48:13 +0000 (10:48 -0400)
README.md

index 23f76e3af8cee7d370741dcfe08fbdddf858fe8e..f5d8ecb975333ae5174c1a9d13c6bdfb6d4fb326 100644 (file)
--- a/README.md
+++ b/README.md
@@ -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.