<commit_before>package theschoolproject; //THis will be the dungeon room, 16x11 = 176 tiles

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import resources.SettingsProperties;

public class Room {

    int width = 17;
    int height = 13;

    int[] tiles = new int[width * height];
    FloorTile[] tileArry = new FloorTile[width * height];
    GamePanel mainPanel;
    SettingsProperties props = new SettingsProperties();

    BufferedImage lvl;
    int drawCycle = 0;

    public Room(GamePanel gp, String LevelImage) {
        mainPanel = gp;
        for (int i = 0; i < tileArry.length; i++) {
            tileArry[i] = new FloorTile(1);
        }
        lvl = UsefulSnippets.loadImage(LevelImage);
        loadLevel();
    }

    public final void loadLevel() {
        lvl.getRGB(0, 0, width, height, tiles, 0, width);
        for (int i = 0; i < lvl.getWidth(); i++) {
            for (int j = 0; j < lvl.getHeight(); j++) {
                
                if (tiles[i + j * width] == 0xFFFFFFFF) {
                    tileArry[i + j * width].setTile(1);
                }
                if (tiles[i + j * width] == 0xFF000000) {
                    tileArry[i + j * width].setTile(2);
                }
                if (tiles[i + j * width] == 0xFF532F00) {
                    tileArry[i + j * width].setTile(3);
                }
                if (tiles[i + j * width] == 0xFF0000ff) {
                    tileArry[i + j * width].setTile(4);
                }
                if (tiles[i + j * width] == 0xFF03a5ff) {
                    tileArry[i + j * width].setTile(5);
                }
                if (tiles[i + j * width] == 0xFF03a5ef){
                    tileArry[i + j * width].setTile(6);
                }
                
            }
        }
        
        System.out.println(tileArry[5+5*width].TILE_ID);
        for (int i = 1; i < lvl.getWidth() - 1; i++) {
            for (int j = 1; j < lvl.getHeight() - 1; j++) {
                if (tileArry[i + j * width].TILE_ID == 1) {
                    if (tileArry[i + (j + 1) * width].TILE_ID == 4) {
                        tileArry[i + j * width].setMetadata(1);
                        tileArry[i + j * width].metaDir = 0;
                    }
                    if (tileArry[i + (j - 1) * width].TILE_ID == 4) {
                        tileArry[i + j * width].setMetadata(1);<commit_msg>Migrated levels from pack (.xcf) to resources (.png), WIP tile animations, metadata, level loading<commit_after>package theschoolproject; //THis will be the dungeon room, 16x11 = 176 tiles

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import resources.SettingsProperties;

public class Room {

    int width = 17;
    int height = 13;

    int[] tiles = new int[width * height];
    FloorTile[] tileArry = new FloorTile[width * height];
    GamePanel mainPanel;
    SettingsProperties props = new SettingsProperties();

    BufferedImage lvl;
    int drawCycle = 0;

    public Room(GamePanel gp, String LevelImage) {
        mainPanel = gp;
        for (int i = 0; i < tileArry.length; i++) {
            tileArry[i] = new FloorTile(1);
        }
        lvl = UsefulSnippets.loadImage(LevelImage);
        loadLevel();
    }

    public final void loadLevel() {
        lvl.getRGB(0, 0, width, height, tiles, 0, width);
        for (int i = 0; i < lvl.getWidth(); i++) {
            for (int j = 0; j < lvl.getHeight(); j++) {
                
                if (tiles[i + j * width] == 0xFFFFFFFF) {
                    tileArry[i + j * width].setTile(1);
                }
                if (tiles[i + j * width] == 0xFF000000) {
                    tileArry[i + j * width].setTile(2);
                }
                if (tiles[i + j * width] == 0xFF532F00) {
                    tileArry[i + j * width].setTile(3);
                }
                if (tiles[i + j * width] == 0xFF0000ff) {
                    tileArry[i + j * width].setTile(4);
                }
                if (tiles[i + j * width] == 0xFF03a5ff) {
                    tileArry[i + j * width].setTile(5);
                }
                if (tiles[i + j * width] == 0xFF03a5ef){
                    tileArry[i + j * width].setTile(6);
                }
//                if (tiles[i + j * width] == 0xFF03a5ef){
//                    tileArry[i + j * width].setTile(7);
//                }
//                if (tiles[i + j * width] == 0xFF03a5ef){
//                    tileArry[i + j * width].setTile(8);
//                }
            }
        }
        
        System.out.println(tileArry[5+5*width].TILE_ID);
        for (int i = 1; i < lvl.getWidth() - 1; i++) {
            for (int j = 1; j < lvl.getHeight() - 1; j++) {
                if (tileArry[i + j * width].TILE_ID == 1) {
                    if (tileArry[i + (j + 1) * width].TILE_ID == 4) {
                        tileArry[i + j * width].setMetadata(1);
                        tileArry[i + j * width].metaDir = 0;
                    }
                    if (tileArry[i + (j - 1) * width].TILE_ID == 4) {
                        tileArry[i + j * width].setMetadata(1);
{'fraction_non_alphanumeric': 0.13501540832049308, 'fraction_numerical': 0.027349768875192602, 'mean_word_length': 1.4187238006520726, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '5192429', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1619, 'n_words': 400}