package org.project.location;

import org.project.entity.enemies.Enemy;
import java.util.ArrayList;
import java.util.List;

public class Location {
    private String name;
    private String description;
    private List<Location> connectedLocations;
    private List<Enemy> enemies;

    public Location(String name, String description) {
        this.name = name;
        this.description = description;
        this.connectedLocations = new ArrayList<>();
        this.enemies = new ArrayList<>();
    }

    public Location(String name, String description, List<Enemy> enemies) {
        this(name, description);
        this.enemies = enemies != null ? enemies : new ArrayList<>();
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public List<Location> getConnectedLocations() {
        return connectedLocations;
    }

    public void addConnectedLocation(Location location) {
        connectedLocations.add(location);
    }

    public List<Enemy> getEnemies() {
        return enemies;
    }

    public void addEnemy(Enemy enemy) {
        enemies.add(enemy);
    }

    public void removeEnemy(Enemy enemy) {
        enemies.remove(enemy);
    }

    public boolean hasEnemies() {
        return !enemies.isEmpty();
    }
}