<commit_before>/**
 * @name 		<NAME>
 * @author 		macdondyla1
 * @email  		<EMAIL>
 * @usercode	300282068
 *
 */

package tile;

import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;


/**
 *
 * Interface for the Tiles
 * Every Tile should inherit this to make working with tiles not impossible
 *
 */
public abstract class Tile {
	protected static boolean[] chars = new boolean[200]; //if this proves to be to few, extend it
	protected Character key;
	protected String type;
	protected boolean hasInteractive = false;
	protected int objIdx = 0;
	protected BufferedImage img;
	protected int heightOffset;
	public Tile(File imgPath, Character key){
		try {
			img = ImageIO.read(imgPath);
		} catch (IOException e) {
			e.printStackTrace();
		}

		if(key < chars.length && !chars[key]){
			this.key = key;
			chars[key] = true;
		}
		else{
			throw new IllegalArgumentException("Key already used, choose another up to char 200");
		}
	}


	/**
	 *
	 * @return A string denoting the type of tile that this represents
	 */
	public String getType(){
		return type;
	}
	/**
	 *
	 * @return an array of objects that are currently located on this tile
	 */
//	public List<GameObject> getElements(){
//		return objs;
//	}


	public boolean draw(Graphics2D g, int dx, int dy){
													  
		g.drawImage(img, dx, dy,null);
		return false;

	}

	public Character getRepresentation(){
		return key;
	}

}
<commit_msg>Updated abs Tile to have an internal offset modifier<commit_after>/**
 * @name 		<NAME>
 * @author 		macdondyla1
 * @email  		<EMAIL>
 * @usercode	300282068
 *
 */

package tile;

import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;


/**
 *
 * Interface for the Tiles
 * Every Tile should inherit this to make working with tiles not impossible
 *
 */
public abstract class Tile {
	protected static boolean[] chars = new boolean[200]; //if this proves to be to few, extend it
	protected Character key;
	protected String type;

	protected BufferedImage img;
	protected int heightOffSet;


	public Tile(File imgPath, Character key){
		try {
			img = ImageIO.read(imgPath);
		} catch (IOException e) {
			e.printStackTrace();
		}

		if(key < chars.length && !chars[key]){
			this.key = key;
			chars[key] = true;
		}
		else{
			throw new IllegalArgumentException("Key already used, choose another up to char 200");
		}

		heightOffSet = img.getHeight();
		heightOffSet = Math.max(32 - heightOffSet, heightOffSet -32);
	}


	/**
	 *
	 * @return A string denoting the type of tile that this represents
	 */
	public String getType(){
		return type;
	}
	/**
	 *
	 * @return an array of objects that are currently located on this tile
	 */
//	public List<GameObject> getElements(){
//		return objs;
//	}


	public boolean draw(Graphics2D g, int dx, int dy){
		return g.drawImage(img, dx, dy,null);


	}

	public Character getRepresentation(){
		return key;
	}

}

{'fraction_non_alphanumeric': 0.11121888134497251, 'fraction_numerical': 0.01325573876495312, 'mean_word_length': 3.3886524822695034, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6050206', 'n_tokens_mistral': 1106, 'n_tokens_neox': 983, 'n_words': 326}