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.OrcMON;
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.tile.interactive.DryTreeTI;

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++;
    }

    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;
    }

    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;
    }

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

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

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

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

}
