<commit_before>package levels;

import java.awt.*;
import java.util.ArrayList;
import levels.Room.RoomType;

/**
 * @author <NAME>
 */
public class Minimap {

    private ArrayList<Room> rooms;
    private ArrayList<MinimapRoom> minimapRooms;

    private int playerRoomX, playerRoomY;

    public Minimap(ArrayList<Room> rooms) {
        this.rooms = rooms;
        minimapRooms = new ArrayList<>();

        Room rootRoom = rooms.get(0);
        playerRoomX = 0;
        playerRoomY = 0;
        setUpRooms(rootRoom, 0, 0);
    }

    public Minimap()
    {
        playerRoomX = 0;
        playerRoomY = 0;
        rooms = new ArrayList<>();
        minimapRooms = new ArrayList<>();
    }

    public void addRoom(Room r)
    {
        rooms.add(r);
    }

    public void setUpRooms()
    {
        Room rootRoom = rooms.get(0);
        setUpRooms(rootRoom, 0, 0);
    }

    public void setUpRooms(Room room, int x, int y) {
        room.setVisited(true);
        minimapRooms.add(new MinimapRoom(room,x,y));

        if (room.getNorth() != null && !room.getNorth().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getNorth(), x, y - 1));
            setUpRooms(room.getNorth(), x, y -1);
        }
        if (room.getSouth() != null && !room.getSouth().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getSouth(), x, y + 1));
            setUpRooms(room.getSouth(), x, y + 1);
        }
        if (room.getEast() != null && !room.getEast().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getEast(), x + 1, y));
            setUpRooms(room.getEast(), x + 1, y);
        }
        if (room.getWest() != null && !room.getWest().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getWest(), x - 1, y));
            setUpRooms(room.getWest(), x - 1, y);
        }
    }

    public void draw(Graphics g) {
        for(MinimapRoom r: minimapRooms)
        {
            RoomType type = r.getRoom().getRoomType();
            if(r.getX() == playerRoomX && r.getY() == playerRoomY)
            {
                g.setColor(Color.WHITE);
            }
            else if(type == RoomType.NORMAL)
            {
                g.setColor(Color.BLACK);
            }
            else if(type == RoomType.BOSS)
            {
                g.setColor(Color.RED);
            }
            else if(type == RoomType.SHOP)
            {
                g.setColor(Color.YELLOW);
            }
            g.fillRect(r.getX() * 11 + 150, r.getY() * 11 + 75, 10,10);
        }
    }

    public int getPlayerRoomX() {
        return playerRoomX;
    }

    public void setPlayerRoomX(int playerRoomX) {
        this.playerRoomX = playerRoomX;
    }

    public int getPlayerRoomY() {
        return playerRoomY;
    }

    public void setPlayerRoomY(int playerRoomY) {
        this.playerRoomY = playerRoomY;
    }

    class MinimapRoom {
        private int x, y;
        private Room room;

        public MinimapRoom(Room r, int x, int y) {
            this.room = r;
            this.x = x;
            this.y = y;
        }

        public int getX() {
            return x;
        }

        public void setX(int x) {
            this.x = x;
        }

        public int getY() {
            return y;
        }

        public void setY(int y) {
            this.y = y;
        }

        public Room getRoom() {
            return room;
        }

        public void setRoom(Room room) {
            this.room = room;
        }
    }
}

<commit_msg>Made locked doors apear as green on the minimap<commit_after>package levels;

import java.awt.*;
import java.util.ArrayList;
import levels.Room.RoomType;

/**
 * @author Conn<NAME>
 */
public class Minimap {

    private ArrayList<Room> rooms;
    private ArrayList<MinimapRoom> minimapRooms;

    private int playerRoomX, playerRoomY;

    public Minimap(ArrayList<Room> rooms) {
        this.rooms = rooms;
        minimapRooms = new ArrayList<>();

        Room rootRoom = rooms.get(0);
        playerRoomX = 0;
        playerRoomY = 0;
        setUpRooms(rootRoom, 0, 0);
    }

    public Minimap()
    {
        playerRoomX = 0;
        playerRoomY = 0;
        rooms = new ArrayList<>();
        minimapRooms = new ArrayList<>();
    }

    public void addRoom(Room r)
    {
        rooms.add(r);
    }

    public void setUpRooms()
    {
        Room rootRoom = rooms.get(0);
        setUpRooms(rootRoom, 0, 0);
    }

    public void setUpRooms(Room room, int x, int y) {
        room.setVisited(true);
        minimapRooms.add(new MinimapRoom(room,x,y));

        if (room.getNorth() != null && !room.getNorth().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getNorth(), x, y - 1));
            setUpRooms(room.getNorth(), x, y -1);
        }
        if (room.getSouth() != null && !room.getSouth().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getSouth(), x, y + 1));
            setUpRooms(room.getSouth(), x, y + 1);
        }
        if (room.getEast() != null && !room.getEast().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getEast(), x + 1, y));
            setUpRooms(room.getEast(), x + 1, y);
        }
        if (room.getWest() != null && !room.getWest().isVisited()) {
            minimapRooms.add(new MinimapRoom(room.getWest(), x - 1, y));
            setUpRooms(room.getWest(), x - 1, y);
        }
    }

    public void draw(Graphics g) {
        for(MinimapRoom r: minimapRooms)
        {
            RoomType type = r.getRoom().getRoomType();
            if(r.getX() == playerRoomX && r.getY() == playerRoomY)
            {
                g.setColor(Color.WHITE);
            }
            else if(r.getRoom().isLocked())
            {
                g.setColor(Color.GREEN);
            }
            else if(type == RoomType.NORMAL)
            {
                g.setColor(Color.BLACK);
            }
            else if(type == RoomType.BOSS)
            {
                g.setColor(Color.RED);
            }
            else if(type == RoomType.SHOP)
            {
                g.setColor(Color.YELLOW);
            }
            g.fillRect(r.getX() * 11 + 150, r.getY() * 11 + 75, 10,10);
        }
    }

    public int getPlayerRoomX() {
        return playerRoomX;
    }

    public void setPlayerRoomX(int playerRoomX) {
        this.playerRoomX = playerRoomX;
    }

    public int getPlayerRoomY() {
        return playerRoomY;
    }

    public void setPlayerRoomY(int playerRoomY) {
        this.playerRoomY = playerRoomY;
    }

    class MinimapRoom {
        private int x, y;
        private Room room;

        public MinimapRoom(Room r, int x, int y) {
            this.room = r;
            this.x = x;
            this.y = y;
        }

        public int getX() {
            return x;
        }

        public void setX(int x) {
            this.x = x;
        }

        public int getY() {
            return y;
        }

        public void setY(int y) {
            this.y = y;
        }

        public Room getRoom() {
            return room;
        }

        public void setRoom(Room room) {
            this.room = room;
        }
    }
}


{'fraction_non_alphanumeric': 0.12703492416863782, 'fraction_numerical': 0.0086266870738834, 'mean_word_length': 1.5856115107913669, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4397449', 'n_tokens_mistral': 2395, 'n_tokens_neox': 2283, 'n_words': 493}