<commit_before>package com.sorbor.grit.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.controllers.Controllers;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.sorbor.grit.Grit;
import com.sorbor.grit.entitys.EntityManager;
import com.sorbor.grit.entitys.units.Helicopter;
import com.sorbor.grit.input.InputController;
import com.sorbor.grit.map.Map;
import com.sorbor.grit.map.WaterRender;
import com.sorbor.grit.util.CameraMovement;

public class GameScreen implements Screen {

	Grit game;
	EntityManager em = new EntityManager();
	SpriteBatch sb = new SpriteBatch();
	CameraMovement cv;
	Viewport vp;
	Map map;
	WaterRender wr;

	public GameScreen(Grit game, InputController[] ic) {
		this.game = game;
		System.out.println(Controllers.getControllers().size);
		for (InputController inputController : ic) {
			em.addEntity(new Helicopter(sb, inputController));
		}
		map = new Map(Gdx.files.internal("Map01.png"));
		wr = new WaterRender(sb);
	}

	@Override
	public void show() {
		vp = new FitViewport(2560, 1440); // Makes virtual screensize QHD
		cv = new CameraMovement(vp.getCamera());
	}

	@Override
	public void render(float delta) {
		cv.update();
		cv.setPosition(em.getEntity(0).getPosition());
		vp.getCamera().update(); // Updates the camera
		sb.setProjectionMatrix(vp.getCamera().combined); // Sets the projection
															// matrix
		em.update(); // Updates all entities
		sb.begin();
		wr.render();
		map.render(sb, new Vector2(), new Vector2());
		em.render(sb); // Renders all entities
		sb.end();

	}

	@Override
	public void resize(int width, int height) {

		// Checks that it is not too small
		if (width < 256) {
			width = 256;
			Gdx.graphics.setDisplayMode(width, height, Gdx.graphics.isFullscreen());
		}
		if (height < 256) {<commit_msg>FPS Added<commit_after>package com.sorbor.grit.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.controllers.Controllers;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.sorbor.grit.Grit;
import com.sorbor.grit.entitys.EntityManager;
import com.sorbor.grit.entitys.units.Helicopter;
import com.sorbor.grit.input.InputController;
import com.sorbor.grit.map.Map;
import com.sorbor.grit.map.WaterRender;
import com.sorbor.grit.util.CameraMovement;

public class GameScreen implements Screen {

	Grit game;
	EntityManager em = new EntityManager();
	SpriteBatch sb = new SpriteBatch();
	CameraMovement cv;
	Viewport vp;
	Map map;
	WaterRender wr;
	BitmapFont bmpFont;

	public GameScreen(Grit game, InputController[] ic) {
		this.game = game;
		System.out.println(Controllers.getControllers().size);
		for (InputController inputController : ic) {
			em.addEntity(new Helicopter(sb, inputController));
		}
		map = new Map(Gdx.files.internal("Map01.png"));
		wr = new WaterRender(sb);
		
		//Font generating
		FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/Esphimere Thin.otf"));
		FreeTypeFontParameter parameter = new FreeTypeFontParameter();
		parameter.size = 25;
		bmpFont = generator.generateFont(parameter);
		generator.dispose();
	}

	@Override
	public void show() {
		vp = new FitViewport(2560, 1440); // Makes virtual screensize QHD
		cv = new CameraMovement(vp.getCamera());
	}

	@Override
	public void render(float delta) {
		cv.update();
		cv.setPosition(em.getEntity(0).getPosition());
		vp.getCamera().update(); // Updates the camera
		sb.setProjectionMatrix(vp.getCamera().combined); // Sets the projection
															// matrix
		em.update(); // Updates all entities
		sb.begin();
		wr.render();
		map.render(sb, new Vector2(), new Vector2());
		em.render(sb); // Renders all entities
		bmpFont.draw(sb, ""+Gdx.graphics.getFramesPerSecond(), em.getEntity(0).getPosition().x-500, em.getEntity(0).getPosition().y+500);
		sb.end();

	}

	@Override
	public void resize(int width, int height) {

		// Checks that it is not too small
		if (width < 256) {
			width = 256;
			Gdx.graphics.setDisplayMode(width, height, Gdx.graphics.isFullscreen());
		}
		if (height < 256) {
{'fraction_non_alphanumeric': 0.13092648977816443, 'fraction_numerical': 0.013266637668551544, 'mean_word_length': 4.507784431137725, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1554919', 'n_tokens_mistral': 1733, 'n_tokens_neox': 1572, 'n_words': 321}