<commit_before>package com.gdxjam.screens;

import com.badlogic.ashley.core.PooledEngine;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.input.GestureDetector;
import com.badlogic.gdx.math.Vector2;
import com.gdxjam.EntityManager;
import com.gdxjam.input.DefaultInputProcessor;
import com.gdxjam.input.DesktopGestureListener;
import com.gdxjam.input.InputAITest;
import com.gdxjam.systems.CameraSystem;
import com.gdxjam.systems.CommanderControllerSystem;
import com.gdxjam.systems.EntityRenderSystem;
import com.gdxjam.systems.PhysicsSystem;
import com.gdxjam.systems.SteeringSystem;
import com.gdxjam.utils.EntityFactory;
import com.gdxjam.utils.GUItest;
import com.gdxjam.utils.generators.WorldGenerator;

public class TestScreen extends AbstractScreen {
	
	private PooledEngine engine;
	private GUItest GUITest;

	@Override
	public void show() {
		InputMultiplexer inputMultiplexer = new InputMultiplexer();

		initEngine();
		// gui needs to be created after engine but before world, for the
		// listener to work
		GUITest = new GUItest(engine);

		createTestWorld();

		// inputs
		inputMultiplexer.addProcessor(GUITest);
		inputMultiplexer.addProcessor(new DefaultInputProcessor());
		inputMultiplexer.addProcessor(new InputAITest(engine));
		inputMultiplexer.addProcessor(new GestureDetector(new DesktopGestureListener(engine)));
		Gdx.input.setInputProcessor(inputMultiplexer);

	}

	public void createTestWorld() {
		EntityFactory.createSquad(new Vector2(15, 5));
		EntityFactory.createSquad(new Vector2(-30, -30));
		EntityFactory.createSquad(new Vector2(0, 30));
		EntityFactory.createSquad(new Vector2(50, 5));
		WorldGenerator.generateForest(new Vector2(20, 20), 25, 7, 0.1f, 0.2f, 0.1f, "tree");
		WorldGenerator.generateForest(new Vector2(-10, 5), 10, 30, 0.1f, 0.2f, 0.05f, "tree");
		
		WorldGenerator.generateForest(new Vector2(20, -20), 50, 15, 0.5f, 2.0f, 0.50f, "mushroom");
		EntityFactory.createFortress(new Vector2(15, 5), 15, 12);
	}

	public void initEngine() {
		engine = EntityManager.getInstance().initSystems();
		engine.addSystem(new CommanderControllerSystem());
	}

	@Override
	public void render(float delta) {
		super.render(delta);

		engine.update(delta);
		GUITest.act(delta);
		GUITest.draw();
	}

}<commit_msg>TestScreen now loads worlds with manager<commit_after>package com.gdxjam.screens;

import com.badlogic.ashley.core.PooledEngine;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.input.GestureDetector;
import com.badlogic.gdx.math.Vector2;
import com.gdxjam.EntityManager;
import com.gdxjam.GameWorld;
import com.gdxjam.input.DefaultInputProcessor;
import com.gdxjam.input.DesktopGestureListener;
import com.gdxjam.input.InputAITest;
import com.gdxjam.systems.CameraSystem;
import com.gdxjam.systems.CommanderControllerSystem;
import com.gdxjam.systems.EntityRenderSystem;
import com.gdxjam.systems.PhysicsSystem;
import com.gdxjam.systems.SteeringSystem;
import com.gdxjam.utils.EntityFactory;
import com.gdxjam.utils.GUItest;
import com.gdxjam.utils.generators.WorldGenerator;

public class TestScreen extends AbstractScreen {
	
	private PooledEngine engine;
	private GUItest GUITest;

	@Override
	public void show() {
		InputMultiplexer inputMultiplexer = new InputMultiplexer();

		initEngine();
		// gui needs to be created after engine but before world, for the
		// listener to work
		GUITest = new GUItest(engine);

		createTestWorld();

		// inputs
		inputMultiplexer.addProcessor(GUITest);
		inputMultiplexer.addProcessor(new DefaultInputProcessor());
		inputMultiplexer.addProcessor(new InputAITest(engine));
		inputMultiplexer.addProcessor(new GestureDetector(new DesktopGestureListener(engine)));
		Gdx.input.setInputProcessor(inputMultiplexer);

	}

	public void createTestWorld() {
		GameWorld world = new GameWorld(64, 36);
		EntityManager.getInstance().loadWorld(world);
		EntityFactory.createSquad(new Vector2(15, 5));
		EntityFactory.createSquad(new Vector2(-30, -30));
		EntityFactory.createSquad(new Vector2(0, 30));
		EntityFactory.createSquad(new Vector2(50, 5));
		WorldGenerator.generateForest(new Vector2(20, 20), 25, 7, 0.1f, 0.2f, 0.1f, "tree");
		WorldGenerator.generateForest(new Vector2(-10, 5), 10, 30, 0.1f, 0.2f, 0.05f, "tree");
		
		WorldGenerator.generateForest(new Vector2(20, -20), 50, 15, 0.5f, 2.0f, 0.50f, "mushroom");
		EntityFactory.createFortress(new Vector2(15, 5), 15, 12);
	}

	public void initEngine() {
		engine = EntityManager.getInstance().initSystems();
		engine.addSystem(new CommanderControllerSystem());
	}

	@Override
	public void render(float delta) {
		super.render(delta);

		engine.update(delta);
		GUITest.act(delta);
		GUITest.draw();
	}

}
{'fraction_non_alphanumeric': 0.11860122182431009, 'fraction_numerical': 0.03075626711607331, 'mean_word_length': 5.753911806543385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4881535', 'n_tokens_mistral': 1842, 'n_tokens_neox': 1586, 'n_words': 309}