package de.miaurizius.jgame2d.core.handlers;

import de.miaurizius.jgame2d.core.GamePanel;
import de.miaurizius.jgame2d.core.enums.Map;
import de.miaurizius.jgame2d.entity.item.*;
import de.miaurizius.jgame2d.entity.monster.BatMON;
import de.miaurizius.jgame2d.entity.monster.OrcMON;
import de.miaurizius.jgame2d.entity.monster.SkeletonLordMON;
import de.miaurizius.jgame2d.entity.npc.BigRockNPC;
import de.miaurizius.jgame2d.entity.npc.MerchantNPC;
import de.miaurizius.jgame2d.entity.npc.OldManNPC;
import de.miaurizius.jgame2d.entity.monster.GreenSlimeMON;
import de.miaurizius.jgame2d.entity.obstacle.ChestObj;
import de.miaurizius.jgame2d.entity.obstacle.DoorObj;
import de.miaurizius.jgame2d.entity.obstacle.IronDoorObj;
import de.miaurizius.jgame2d.tile.interactive.DestructibleWallIT;
import de.miaurizius.jgame2d.tile.interactive.DryTreeIT;
import de.miaurizius.jgame2d.tile.interactive.MetalPlateIT;

public class AssetSetter {

    GamePanel panel;

    public AssetSetter(GamePanel panel) {
        this.panel = panel;
    }

    public void setObject() {
        int i = 0;
        panel.obj[Map.OVERWORLD.getIndex()][i] = new AxeObj(panel);
        panel.obj[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*33;
        panel.obj[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*21;
        i++;

        panel.obj[Map.OVERWORLD.getIndex()][i] = new DoorObj(panel);
        panel.obj[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*14;
        panel.obj[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*28;
        i++;

        panel.obj[Map.OVERWORLD.getIndex()][i] = new DoorObj(panel);
        panel.obj[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*12;
        panel.obj[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*12;
        i++;

        panel.obj[Map.OVERWORLD.getIndex()][i] = new ChestObj(panel);
        panel.obj[Map.OVERWORLD.getIndex()][i].setLoot(new KeyObj(panel));
        panel.obj[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*30;
        panel.obj[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*29;
        i++;

        i = 0;
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new ChestObj(panel);
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].setLoot(new PickaxeObj(panel));
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*40;
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*41;
        i++;

        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new ChestObj(panel);
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].setLoot(new PotionObj(panel));
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*13;
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*16;
        i++;

        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new ChestObj(panel);
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].setLoot(new PotionObj(panel));
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*26;
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*34;
        i++;

        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new ChestObj(panel);
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].setLoot(new PotionObj(panel));
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*27;
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*15;
        i++;

        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new IronDoorObj(panel);
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*18;
        panel.obj[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*23;
        i++;
    }

    public void setNPC() {
        panel.npc[Map.OVERWORLD.getIndex()][0] = new OldManNPC(panel);
        panel.npc[Map.OVERWORLD.getIndex()][0].worldX = panel.tileSize*21;
        panel.npc[Map.OVERWORLD.getIndex()][0].worldY = panel.tileSize*21;

        panel.npc[Map.HUT.getIndex()][0] = new MerchantNPC(panel);
        panel.npc[Map.HUT.getIndex()][0].worldX = panel.tileSize*12;
        panel.npc[Map.HUT.getIndex()][0].worldY = panel.tileSize*7;


        int i = 0;
        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BigRockNPC(panel);
        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*20;
        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*25;
        i++;

        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BigRockNPC(panel);
        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*11;
        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*18;
        i++;

        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BigRockNPC(panel);
        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*23;
        panel.npc[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*14;
        i++;
    }

    public void setMonster() {
        int i = 0;
        panel.monster[Map.OVERWORLD.getIndex()][i] = new GreenSlimeMON(panel);
        panel.monster[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*23;
        panel.monster[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*36;

        i++;
        panel.monster[Map.OVERWORLD.getIndex()][i] = new GreenSlimeMON(panel);
        panel.monster[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*23;
        panel.monster[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*37;

        i++;
        panel.monster[Map.OVERWORLD.getIndex()][i] = new GreenSlimeMON(panel);
        panel.monster[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*24;
        panel.monster[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*37;

        i++;
        panel.monster[Map.OVERWORLD.getIndex()][i] = new GreenSlimeMON(panel);
        panel.monster[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*34;
        panel.monster[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*42;

        i++;
        panel.monster[Map.OVERWORLD.getIndex()][i] = new GreenSlimeMON(panel);
        panel.monster[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*38;
        panel.monster[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*42;

        i++;
        panel.monster[Map.OVERWORLD.getIndex()][i] = new OrcMON(panel);
        panel.monster[Map.OVERWORLD.getIndex()][i].worldX = panel.tileSize*12;
        panel.monster[Map.OVERWORLD.getIndex()][i].worldY = panel.tileSize*33;

        i = 0;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BatMON(panel);
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*34;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*39;

        i++;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BatMON(panel);
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*36;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*25;

        i++;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BatMON(panel);
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*39;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*26;

        i++;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BatMON(panel);
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*28;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*11;

        i++;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new BatMON(panel);
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldX = panel.tileSize*10;
        panel.monster[Map.DUNGEON_FIRST_FLOOR.getIndex()][i].worldY = panel.tileSize*19;

        i = 0;
        panel.monster[Map.DUNGEON_SECOND_FLOOR.getIndex()][i] = new SkeletonLordMON(panel);
        panel.monster[Map.DUNGEON_SECOND_FLOOR.getIndex()][i].worldX = panel.tileSize*23;
        panel.monster[Map.DUNGEON_SECOND_FLOOR.getIndex()][i].worldY = panel.tileSize*16;
    }

    public void setITiles() {
        int i = 0;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,27,12);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,28,12);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,29,12);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,30,12);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,31,12);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,32,12);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,33,12);i++;

        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,30,21);i++;

        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,25,27);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,26,27);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,27,27);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,27,28);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,27,29);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,27,30);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,27,31);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,28,31);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,29,31);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,30,31);i++;

        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,18,40);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,17,40);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,16,40);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,15,40);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,14,40);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,13,40);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,13,41);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,12,41);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,11,41);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,10,41);i++;
        panel.iTile[Map.OVERWORLD.getIndex()][i] = new DryTreeIT(panel,10,40);i++;

        i = 0;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,18,30);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,17,31);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,17,32);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,17,34);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,18,34);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,18,33);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,10,22);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,10,24);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,38,18);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,38,19);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,38,20);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,38,21);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,18,13);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,18,14);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,22,28);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,30,28);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new DestructibleWallIT(panel,32,28);i++;

        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new MetalPlateIT(panel,20,22);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new MetalPlateIT(panel,8,17);i++;
        panel.iTile[Map.DUNGEON_FIRST_FLOOR.getIndex()][i] = new MetalPlateIT(panel,39,31);i++;
    }

}
