<commit_before>package com.jed.state;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Stack;

import com.jed.actor.AbstractEntity;
import com.jed.core.MotherBrainConstants;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;

import com.jed.actor.Player;
import com.jed.core.Collision;
import com.jed.core.QuadTree;
import com.jed.util.Rectangle;
import com.jed.util.Util;
import com.jed.util.Vector;


/**
 * 
 * @author jlinde, <NAME>
 *
 * TODO Decouple from com.jed.core.MotherBrain / com.jed.core.MotherBrainConstants
 *
 */
public class GameMap extends AbstractDisplayableState {

    /**
     * 
     */
    public int width, height, tileWidth, tileHeight;

    /**
     * 
     */
    private String tileSetPath;

    /**
     * 
     */
    //TODO: this should be set when the map loads...
    public Vector position = new Vector(0, 0);

    /**
     * 
     */
    public MapTile[] tiles;

    /**
     * 
     */
    private Texture texture;

    /**
     * 
     */
    private Player player;
    
    /**
     * 
     */
    private Stack<AbstractEntity> scene;

    /**
     * 
     */
    private QuadTree quadTree;

    /**
     * 
     */
    public float gravity = 0.21875f;

    @Override
    public void entered() {
        texture = Util.loadTexture(tileSetPath);

        //TODO: initialize scene Stack by some data contained in the map i.e. start position or something like that...
        scene = new Stack<>();
        player = new Player(new Vector(50, 200), 256, 256, this);
        scene.push(player);

        quadTree = new QuadTree(
                new Vector(0, 0), 0,
                new Rectangle(
                        width * tileWidth,
                        height * tileHeight),
                this);

        //TODO: the quad tree should come pre-populated with all map tiles
        // and should only add and remove map entities...

        //Draw the map once prior to the first update to ensure the quad tree
        //is populated with map tiles on the first frame
        drawMap();
    }

    @Override
    public void leaving() {
    }

    /**
     * 
     */
    public void keyPress() {
        player.keyPressEvent();
    }

    @Override
    public void update() {<commit_msg>Removed superfluous override.<commit_after>package com.jed.state;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Stack;

import com.jed.actor.AbstractEntity;
import com.jed.core.MotherBrainConstants;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;

import com.jed.actor.Player;
import com.jed.core.Collision;
import com.jed.core.QuadTree;
import com.jed.util.Rectangle;
import com.jed.util.Util;
import com.jed.util.Vector;


/**
 * 
 * @author jlinde, <NAME>
 *
 * TODO Decouple from com.jed.core.MotherBrain / com.jed.core.MotherBrainConstants
 *
 */
public class GameMap extends AbstractDisplayableState {

    /**
     * 
     */
    public int width, height, tileWidth, tileHeight;

    /**
     * 
     */
    private String tileSetPath;

    /**
     * 
     */
    //TODO: this should be set when the map loads...
    public Vector position = new Vector(0, 0);

    /**
     * 
     */
    public MapTile[] tiles;

    /**
     * 
     */
    private Texture texture;

    /**
     * 
     */
    private Player player;
    
    /**
     * 
     */
    private Stack<AbstractEntity> scene;

    /**
     * 
     */
    private QuadTree quadTree;

    /**
     * 
     */
    public float gravity = 0.21875f;

    @Override
    public void entered() {
        texture = Util.loadTexture(tileSetPath);

        //TODO: initialize scene Stack by some data contained in the map i.e. start position or something like that...
        scene = new Stack<>();
        player = new Player(new Vector(50, 200), 256, 256, this);
        scene.push(player);

        quadTree = new QuadTree(
                new Vector(0, 0), 0,
                new Rectangle(
                        width * tileWidth,
                        height * tileHeight),
                this);

        //TODO: the quad tree should come pre-populated with all map tiles
        // and should only add and remove map entities...

        //Draw the map once prior to the first update to ensure the quad tree
        //is populated with map tiles on the first frame
        drawMap();
    }

    /**
     * 
     */
    public void keyPress() {
        player.keyPressEvent();
    }

    @Override
    public void update() {
{'fraction_non_alphanumeric': 0.11085056491153272, 'fraction_numerical': 0.010232359837987636, 'mean_word_length': 1.9343339587242026, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3617676', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1387, 'n_words': 388}