<commit_before>package wge3.world;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import wge3.entity.character.Player;
import wge3.entity.creatures.Zombie;
import wge3.entity.ground.Direction;
import wge3.entity.ground.Grass;
import wge3.entity.ground.Lava;
import wge3.entity.ground.OneWayTile;
import wge3.entity.ground.Water;
import wge3.entity.ground.WoodenFloor;
import wge3.entity.items.Bomb;
import wge3.entity.items.Handgun;
import wge3.entity.mapobjects.BrickWall;
import wge3.entity.mapobjects.StoneWall;
import wge3.entity.terrainelements.Ground;
import wge3.entity.terrainelements.MapObject;

public final class MapLoader {
    
    private Scanner mapFileReader;
    
    public void loadMap(String mapName, Area area) throws FileNotFoundException {
        int size = area.getSize();
        String newline = System.getProperty("line.separator");
        System.out.println(newline);
        Scanner mapLoader = new Scanner(new File("maps/" + mapName + ".tmx"));
        mapLoader.useDelimiter("[,\n]");
        for (int i = 0; i < 7; i++) mapLoader.nextLine();
        
        // Create tiles and load grounds:
        for (int y = size-1; y >= 0; y--) {
            for (int x = 0; x < size; x++) {
                Ground ground;
                switch (mapLoader.nextInt()) {
                    case 1: ground = new Grass(); break;
                    case 2: ground = new WoodenFloor(); break;
                    case 3: ground = new Water(); break;
                    case 4: ground = new Lava(); break;
                        <commit_msg>fixed windows crash<commit_after>package wge3.world;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import wge3.entity.character.Player;
import wge3.entity.creatures.Zombie;
import wge3.entity.ground.Direction;
import wge3.entity.ground.Grass;
import wge3.entity.ground.Lava;
import wge3.entity.ground.OneWayTile;
import wge3.entity.ground.Water;
import wge3.entity.ground.WoodenFloor;
import wge3.entity.items.Bomb;
import wge3.entity.items.Handgun;
import wge3.entity.mapobjects.BrickWall;
import wge3.entity.mapobjects.StoneWall;
import wge3.entity.terrainelements.Ground;
import wge3.entity.terrainelements.MapObject;

public final class MapLoader {
    
    private Scanner mapFileReader;
    
    public void loadMap(String mapName, Area area) throws FileNotFoundException {
        int size = area.getSize();
        String newline = System.getProperty("line.separator");
        Scanner mapLoader = new Scanner(new File("maps/" + mapName + ".tmx"));
        mapLoader.useDelimiter("[," + newline + "]");
        for (int i = 0; i < 7; i++) mapLoader.nextLine();
        
        // Create tiles and load grounds:
        for (int y = size-1; y >= 0; y--) {
            for (int x = 0; x < size; x++) {
                Ground ground;
                switch (mapLoader.nextInt()) {
                    case 1: ground = new Grass(); break;
                    case 2: ground = new WoodenFloor(); break;
                    case 3: ground = new Water(); break;
                    case 4: ground = new Lava(); break;
                        
{'fraction_non_alphanumeric': 0.11487758945386065, 'fraction_numerical': 0.015065913370998116, 'mean_word_length': 2.5768799102132434, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3084539', 'n_tokens_mistral': 1004, 'n_tokens_neox': 969, 'n_words': 244}