<commit_before>package com.punchline.javalib.entities.components.tile;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TmxMapLoader;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
import com.badlogic.gdx.math.Vector2;
import com.punchline.javalib.entities.EntityWorld;
import com.punchline.javalib.entities.components.Component;
import com.punchline.javalib.entities.components.ComponentManager;
import com.punchline.javalib.entities.components.physical.Transform;
import com.punchline.javalib.entities.components.render.Renderable;
import com.punchline.javalib.utils.Convert;
import com.punchline.javalib.utils.Display;

/**
 * Component wrapper for a LibGDX tile map. 
 * @author Natman64
 * @created Aug 1, 2013
 */
public class TileMap implements Component, Renderable, Transform {

	private static TmxMapLoader loader = new TmxMapLoader();
	
	private TiledMap map;
	private MapBodyManager bodyManager;
	private OrthogonalTiledMapRenderer renderer;
	
	/**
	 * Constructs a TileMap component.
	 * @param world The EntityWorld containing this map.
	 * @param mapFilename The file path of the map's .tmx file.
	 * @param materialsFilename The file path of the XML file containing the materials info for the map.
	 */
	public TileMap(EntityWorld world, String mapFilename, String materialsFilename) {
		map = loader.load(mapFilename);
		
		bodyManager = new MapBodyManager(world.getPhysicsWorld(), 
				Convert.getMeterPixelRatio(), materialsFilename, 0);
		
		renderer = new OrthogonalTiledMapRenderer(map);
	}
	
	//region Transform Implementation
	
	@Override
	public Vector2 getPosition() {
		return Vector2.Zero.cpy();
	}

	@Override
	public float getRotation() {
		return 0f;
	}

	@Override
	public Vector2 getOrigin() {
		return Vector2.Zero.cpy();
	}

	@Override
	public float getWidth() {
		return 0f;
	}

	@Override
	public float getHeight() {
		return 0f;<commit_msg>More documentation on TileMap.java<commit_after>package com.punchline.javalib.entities.components.tile;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TmxMapLoader;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
import com.badlogic.gdx.math.Vector2;
import com.punchline.javalib.entities.EntityWorld;
import com.punchline.javalib.entities.components.Component;
import com.punchline.javalib.entities.components.ComponentManager;
import com.punchline.javalib.entities.components.physical.Transform;
import com.punchline.javalib.entities.components.render.Renderable;
import com.punchline.javalib.utils.Convert;
import com.punchline.javalib.utils.Display;

/**
 * Component wrapper for a map made in Tiled. When added to an Entity, this will automatically add bodies to the
 * Box2D physics world, as defined by the Tiled map's "physics" object layer and the given materials XML file.
 * @author Natman64
 * @created Aug 1, 2013
 */
public class TileMap implements Component, Renderable, Transform {

	//region Fields/Initialization
	
	private static TmxMapLoader loader = new TmxMapLoader();
	
	private TiledMap map;
	private MapBodyManager bodyManager;
	private OrthogonalTiledMapRenderer renderer;
	
	/**
	 * Constructs a TileMap component.
	 * @param world The EntityWorld containing this map.
	 * @param mapFilename The file path of the map's .tmx file.
	 * @param materialsFilename The file path of the XML file containing the materials info for the map.
	 */
	public TileMap(EntityWorld world, String mapFilename, String materialsFilename) {
		map = loader.load(mapFilename);
		
		bodyManager = new MapBodyManager(world.getPhysicsWorld(), 
				Convert.getMeterPixelRatio(), materialsFilename, 0);
		
		renderer = new OrthogonalTiledMapRenderer(map);
	}
	
	//endregion
	
	//region Transform Implementation
	
	@Override
	public Vector2 getPosition() {
		return Vector2.Zero.cpy();
	}

	@Override
	public float getRotation() {
		return 0f;
	}

	@Override
	public Vector2 getOrigin() {
		return Vector2.Zero.cpy();
	}

	@Override
	public float getWidth() {
		return 0f;
	}

	@Override
	public float getHeight() {
		return 0f;
{'fraction_non_alphanumeric': 0.09168443496801706, 'fraction_numerical': 0.008291873963515755, 'mean_word_length': 4.815426997245179, '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': '1794171', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1295, 'n_words': 334}