package org.project.location;

import org.project.entity.enemies.Enemy;
import org.project.entity.enemies.Skeleton;
import org.project.item.weapons.BoneHarpoon;
import org.project.item.weapons.Sword;
import org.project.item.weapons.Weapon;

import java.util.ArrayList;
import java.util.Random;
public class Location {
    private String name;

    private ArrayList<Enemy> enemies;

    public Location() {
        this.name = pickName();
        this.enemies = new ArrayList<>();
        addEnemy();
    }

    public Location(String name, ArrayList<Enemy> enemies) {
        this.name = name;
        this.enemies = enemies;
        addEnemy();
    }

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

    private void addEnemy() {
        Random random = new Random();
        int enemyId = random.nextInt(3);
        Enemy e = null;
        switch (enemyId) {
            case 0: e = new Skeleton(); break;
            case 1: e = new Skeleton(); break;
            case 2: e = new Skeleton(); break;
        }
        this.enemies.add(e);
    }
    private void addSkeleton() {
        Enemy e = new Skeleton();
        this.enemies.add(e);
    }
    private void addGoblin() {
        Enemy e = null;
        this.enemies.add(e);
    }
    private void addVampire() {
        Enemy e = null;
        this.enemies.add(e);
    }
    public static String pickName() {
        String[] locations = {
            "Tomb", "Yard", "Road", "Jungle", "Pit", "Swamp", "Hill",
            "Den", "Ditch", "Cave", "Bog", "Woods", "Cliff", "Edge",
            "Crack", "Brush", "Mound"
        };
        Random rand = new Random();
        String chosen = locations[rand.nextInt(locations.length)];
        return chosen;
    }


    public String getName() {
        return name;
    }

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