<commit_before>package se.jakobsvensson.evoagar.systems;



import se.jakobsvensson.evoagar.components.Size;
import se.jakobsvensson.evoagar.components.Species;
import se.jakobsvensson.evoagar.components.Transform;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.EntitySystem;
import com.artemis.utils.ImmutableBag;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;

public class RenderSystem extends EntitySystem{
	
	private ShapeRenderer shaperenderer;
	private Camera camera;
	private ComponentMapper<Size> sizemapper;
	private ComponentMapper<Transform> transformmapper;
	private ComponentMapper<Species> speciesmapper;
	
	public RenderSystem(Camera camera) {
		super(Aspect.getAspectForAll(Size.class, Transform.class));
		shaperenderer = new ShapeRenderer();
		this.camera = camera;
		
	}
	
	@Override
	protected void initialize(){
		sizemapper = world.getMapper(Size.class);
		transformmapper = world.getMapper(Transform.class);
		speciesmapper = world.getMapper(Species.class);
	}
	
	@Override
	protected boolean checkProcessing() {
		return true;
	}

	@Override
	protected void processEntities(ImmutableBag<Entity> entities) {
		shaperenderer.setProjectionMatrix(camera.combined);
		shaperenderer.begin(ShapeType.Filled);
		for(int i = 0; i<entities.size();i++){
			Size size = sizemapper.get(entities.get(i));
			Transform transform = transformmapper.get(entities.get(i));
			Species species = speciesmapper.get(entities.get(i));
			if(species!=null){
				shaperenderer.setColor(species.getColor());
			}
			shaperenderer.circle(transform.getX(), transform.getY(), size.getRadius());
		}	
		shaperenderer.end();

	}

}<commit_msg>Added clearing to the rendering<commit_after>package se.jakobsvensson.evoagar.systems;



import se.jakobsvensson.evoagar.components.Size;
import se.jakobsvensson.evoagar.components.Species;
import se.jakobsvensson.evoagar.components.Transform;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.EntitySystem;
import com.artemis.utils.ImmutableBag;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;

public class RenderSystem extends EntitySystem{
	
	private ShapeRenderer shaperenderer;
	private Camera camera;
	private ComponentMapper<Size> sizemapper;
	private ComponentMapper<Transform> transformmapper;
	private ComponentMapper<Species> speciesmapper;
	
	public RenderSystem(Camera camera) {
		super(Aspect.getAspectForAll(Size.class, Transform.class));
		shaperenderer = new ShapeRenderer();
		this.camera = camera;
		
	}
	
	@Override
	protected void initialize(){
		sizemapper = world.getMapper(Size.class);
		transformmapper = world.getMapper(Transform.class);
		speciesmapper = world.getMapper(Species.class);
	}
	
	@Override
	protected boolean checkProcessing() {
		return true;
	}

	@Override
	protected void processEntities(ImmutableBag<Entity> entities) {
		shaperenderer.setProjectionMatrix(camera.combined);
		shaperenderer.begin(ShapeType.Filled);
		shaperenderer.flush();
		for(int i = 0; i<entities.size();i++){
			Size size = sizemapper.get(entities.get(i));
			Transform transform = transformmapper.get(entities.get(i));
			Species species = speciesmapper.get(entities.get(i));
			if(species!=null){
				shaperenderer.setColor(species.getColor());
			}
			shaperenderer.circle(transform.getX(), transform.getY(), size.getRadius());
		}	
		shaperenderer.end();

	}

}
{'fraction_non_alphanumeric': 0.11216988837462565, 'fraction_numerical': 0.0005445140212360468, 'mean_word_length': 5.816326530612245, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2012166', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1151, 'n_words': 197}