<commit_before>package prototypev.PermissiveFov.LevelGeneration.Entities;

import prototypev.PermissiveFov.LevelGeneration.TileType;

import java.util.Arrays;

public class Level {
    public final int width;
    public final int height;

    private final TileType[][] tileTypes;

    public Level(int width, int height) {
        this.width = width;
        this.height = height;

        tileTypes = new TileType[height][width];

        // Initialize all cells to WALL
        for (TileType[] row : tileTypes) {
            Arrays.fill(row, TileType.WALL);
        }
    }

    public TileType getTileTypeAt(int x, int y) {
        return tileTypes[y][x];
    }

    public void setTileTypeAt(int x, int y, TileType tileType) {
        tileTypes[y][x] = tileType;
    }

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();

        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
                TileType tileType = getTileTypeAt(x, y);
                stringBuilder.append(tileType);
            }

            stringBuilder.append(System.getProperty("line.separator"));
        }
<commit_msg>Add helper method to Level to determine OOB<commit_after>package prototypev.PermissiveFov.LevelGeneration.Entities;

import prototypev.PermissiveFov.LevelGeneration.TileType;

import java.util.Arrays;

public class Level {
    public final int width;
    public final int height;

    private final TileType[][] tileTypes;

    public Level(int width, int height) {
        this.width = width;
        this.height = height;

        tileTypes = new TileType[height][width];

        // Initialize all cells to WALL
        for (TileType[] row : tileTypes) {
            Arrays.fill(row, TileType.WALL);
        }
    }

    public TileType getTileTypeAt(int x, int y) {
        return tileTypes[y][x];
    }

    public void setTileTypeAt(int x, int y, TileType tileType) {
        tileTypes[y][x] = tileType;
    }

    /**
     * @param x The horizontal component.
     * @param y The vertical component.
     * @return true if the specified co-ordinates is outside the bounds of this level; otherwise false.
     */
    public boolean isOutOfBounds(int x, int y) {
        return x < 0 || y < 0 || y >= height || x >= width;
    }

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();

        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
                TileType tileType = getTileTypeAt(x, y);
                stringBuilder.append(tileType);
            }

            stringBuilder.append(System.getProperty("line.separator"));
        }

{'fraction_non_alphanumeric': 0.10316875460574797, 'fraction_numerical': 0.002210759027266028, 'mean_word_length': 2.290909090909091, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4943024', 'n_tokens_mistral': 804, 'n_tokens_neox': 780, 'n_words': 227}