From fcd25e47987a8fd35a1712201dcc035707fd462c Mon Sep 17 00:00:00 2001
From: realtradam
+<!--
--> <!-- this is busted -->
Check out the comprehensive documentation here!
+Check out the comprehensive documentation here!
Entities module:
@entity.components[@component_manager] # => [@component1, @component2, @component3]
+You can execute a block for each entity that has all matching component types attached to it like so:
+ +FelECS::Entities.group(@component_manager_one, @component_manager_two).do |cmp1, cmp2, ent|
+ # do stuff with the components and entity
+end
+
+# or
+
+FelECS::Entities.group(@mgr1, @mgr2, @mgr3, @mgr4).do |cmp1, cmp2, cmp3, cmp4, ent|
+ # do stuff with the components and entity
+end
+
+# or
+
+FelECS::Entities.group(@component_manager_one).do |cmp1, ent|
+ # do stuff with the component and entity
+end
+
+# etc
+
+
+You can use any number of component managers and it will only iterate over all entities that have at least all these components from these managers attached to them. The arguments in the block(the arguments surrounded by |pipes|) always correspond to each component manager passed as parameters into the group method and then followed by the entity object.
+This means there will be a number of these arguments equal to the number of component managers passed into the group method plus one for the entity.
To have all Components from an Entity removed and the Entity deleted we do the following:
@@ -550,7 +577,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. -- cgit v1.2.3