// TODO: improve by stacking events and apply them all at the same time or something in the process method.
@Override
	public void handleEvent(Event event) {
		List<Entity> entities = entityManager.getEntitiesContainingComponent(VisionComponent.class);
		if (entities == null)
			return;
		EntityCreatedEvent entityCreatedEvent = (EntityCreatedEvent) event;
		for (Entity entity : entities) {
			VisionComponent visionComponent = (VisionComponent) entityManager.getComponentInEntity(entity, VisionComponent.class);
			visionComponent.createEntity(entityCreatedEvent.getEntity());
			System.out.println("EntityEvent: " + entityCreatedEvent.getEntity());
		}
	}
@Override
public void handleEvent(Event event) {
List<Entity> entities = entityManager.getEntitiesContainingComponent(VisionComponent.class);
if (entities == null)
return;
EntityCreatedEvent entityCreatedEvent = (EntityCreatedEvent) event;
for (Entity entity : entities) {
VisionComponent visionComponent = (VisionComponent) entityManager.getComponentInEntity(entity, VisionComponent.class);
visionComponent.createEntity(entityCreatedEvent.getEntity());
System.out.println("EntityEvent: " + entityCreatedEvent.getEntity());
}
}
@Override
public void handleEvent(Event event) {
List<Entity> entities = entityManager.getEntitiesContainingComponent(VisionComponent.class);
if (entities == null)
return;
EntityCreatedEvent entityCreatedEvent = (EntityCreatedEvent) event;
for (Entity entity : entities) {
VisionComponent visionComponent = (VisionComponent) entityManager.getComponentInEntity(entity, VisionComponent.class);
visionComponent.createEntity(entityCreatedEvent.getEntity());
System.out.println("EntityEvent: " + entityCreatedEvent.getEntity());
}
}
@Override
public void handleEvent(Event event) {
List<Entity> entities = entityManager.getEntitiesContainingComponent(VisionComponent.class);
if (entities == null)
return;
EntityCreatedEvent entityCreatedEvent = (EntityCreatedEvent) event;
for (Entity entity : entities) {
VisionComponent visionComponent = (VisionComponent) entityManager.getComponentInEntity(entity, VisionComponent.class);
visionComponent.createEntity(entityCreatedEvent.getEntity());
System.out.println("EntityEvent: " + entityCreatedEvent.getEntity());
}
}