package org.project.location;

import org.project.entity.enemies.Enemy;

public class Location {
    private String name;
    private Enemy enemy;
    private boolean playerInside = false;

    public Location(String name) {
        this.name = name;
        this.enemy = null;
    }

    public Location(String name, Enemy enemy) {
        this.name = name;
        this.enemy = enemy;
    }

    public String getName() {
        return name;
    }

    public Enemy getEnemy() {

        return enemy;
    }

    public void setPlayerInside(boolean value){

        playerInside = value;
    }

    public void setEnemy(Enemy enemy) {

        this.enemy = enemy;
    }

    public boolean hasEnemy() {

        return enemy != null && !enemy.isDead();
    }

    public boolean hasPlayer() {

        return playerInside;
    }

    public void clearEnemy() {

        this.enemy = null;
    }
}
