for(int i=0; i<NUMBER_ENTITIES; i++){
Entity entity = engine.createEntity();
entity.add(new MovementComponent(10, 10));
entity.add(new PositionComponent(0, 0));
engine.addEntity(entity);
entities.add(entity);
}
System.out.println("Entities added time: " + timer.stop("entities") + "ms");
/** Removing components */
timer.start("componentRemoved");
for(Entity e:entities){
e.remove(PositionComponent.class);
}
System.out.println("Component removed time: " + timer.stop("componentRemoved") + "ms");
/** Adding components */
timer.start("componentAdded");
for(Entity e:entities){
e.add(new PositionComponent(0, 0));
}
System.out.println("Component added time: " + timer.stop("componentAdded") + "ms");
/** System processing */