@@ -0,0 +1,1475 @@
+package net.mgsx.game.plugins.btree.tasks;%0A%0Aimport com.badlogic.ashley.core.Entity;%0Aimport com.badlogic.gdx.ai.btree.annotation.TaskAttribute;%0A%0Aimport net.mgsx.game.core.annotations.TaskAsset;%0Aimport net.mgsx.game.core.storage.EntityGroup;%0Aimport net.mgsx.game.core.storage.EntityGroupStorage;%0Aimport net.mgsx.game.plugins.btree.BTreePlugin.EntityLeafTask;%0Aimport net.mgsx.game.plugins.btree.annotations.TaskAlias;%0Aimport net.mgsx.game.plugins.core.components.Transform2DComponent;%0A%0A@TaskAlias(%22emit%22)%0Apublic class EntityGroupEmitter extends EntityLeafTask%0A%7B%0A%09@TaskAsset(EntityGroup.class)%0A%09@TaskAttribute(required=true)%0A%09public String fileName;%0A%09%0A%09/** when relative, current entity position is added to emitted entities position. When not (absolute)%0A%09 * then emitted entities position is set to current entity position. */%0A%09@TaskAttribute%0A%09public boolean relative = false;%0A%09%0A%09@Override%0A%09public com.badlogic.gdx.ai.btree.Task.Status execute() %0A%09%7B%0A%09%09Transform2DComponent selfTransform = Transform2DComponent.components.get(getEntity());%0A%09%09for(Entity entityClone : EntityGroupStorage.get(getObject().assets, getObject().engine, fileName))%7B%0A%09%09%09if(selfTransform != null)%7B%0A%09%09%09%09Transform2DComponent transform = Transform2DComponent.components.get(entityClone);%0A%09%09%09%09if(transform != null)%7B%0A%09%09%09%09%09if(relative)%7B%0A%09%09%09%09%09%09transform.position.add(selfTransform.position);%0A%09%09%09%09%09%7Delse%7B%0A%09%09%09%09%09%09transform.position.set(selfTransform.position);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return Status.SUCCEEDED;%0A%09%7D%0A%7D%0A

common btree task to emit entity group