<commit_before>package de.tarent.mica.model;

import java.awt.Dimension;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Field {
	public static enum Element{	//TODO: Besseren Namen dafür finde ;)
		UNBEKANNT('?'),
		SCHIFF('*'),
		WASSER('~');
		
		private char sign;
		
		private Element(char sign){
			this.sign = sign;
		}
		
		public char getSign() {
			return sign;
		}
	}
	
	private Element[][] area;
	
	/*
	 * Only for tests
	 */
	Field(Element[][] elements) {
		this.area = elements;
	}

	public Field(int heigth, int width) {
		if(heigth <= 0 || width <= 0) throw new IllegalArgumentException("Width and/or height must be higher than 0!");
		
		this.area = new Element[heigth][width];
		
		for(int i=0; i < heigth; i++){
			Arrays.fill(area[i], Element.UNBEKANNT);
		}
	}
	
	/**
	 * Liefert das {@link Element} an der angegebenen {@link Coord}inate.
	 * 
	 * @param c
	 * @return
	 */
	public Element get(Coord c){
		if(c.getX() >= area[0].length || c.getY() >= area.length)
			throw new IllegalArgumentException("The given Coordinate(" + c + ") is out of bounce!");
		
		return area[c.getY()][c.getX()];
	}
	
	/**
	 * Setzt das {@link Element} an die angegebene {@link Coord}inate.
	 * <commit_msg>* rechtschreibfehler<commit_after>package de.tarent.mica.model;

import java.awt.Dimension;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Field {
	public static enum Element{	//TODO: Besseren Namen dafür finde ;)
		UNBEKANNT('?'),
		SCHIFF('*'),
		WASSER('~');
		
		private char sign;
		
		private Element(char sign){
			this.sign = sign;
		}
		
		public char getSign() {
			return sign;
		}
	}
	
	private Element[][] area;
	
	/*
	 * Only for tests
	 */
	Field(Element[][] elements) {
		this.area = elements;
	}

	public Field(int height, int width) {
		if(height <= 0 || width <= 0) throw new IllegalArgumentException("Width and/or height must be higher than 0!");
		
		this.area = new Element[height][width];
		
		for(int i=0; i < height; i++){
			Arrays.fill(area[i], Element.UNBEKANNT);
		}
	}
	
	/**
	 * Liefert das {@link Element} an der angegebenen {@link Coord}inate.
	 * 
	 * @param c
	 * @return
	 */
	public Element get(Coord c){
		if(c.getX() >= area[0].length || c.getY() >= area.length)
			throw new IllegalArgumentException("The given Coordinate(" + c + ") is out of bounce!");
		
		return area[c.getY()][c.getX()];
	}
	
	/**
	 * Setzt das {@link Element} an die angegebene {@link Coord}inate.
	 * 
{'fraction_non_alphanumeric': 0.1595361855257897, 'fraction_numerical': 0.003998400639744102, 'mean_word_length': 3.3137931034482757, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '6951502', 'n_tokens_mistral': 989, 'n_tokens_neox': 868, 'n_words': 237}