From 21ba97c1b7df9909bffa36b573fb3451338cdf10 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Fri, 4 Oct 2013 10:48:13 -0400 Subject: Document dependency helper. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 23f76e3..f5d8ecb 100644 --- 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>(); +``` + #### Implementation notes - Components must provide a no-argument constructor. -- cgit v1.2.3