package data.scripts.world.imperium;

import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.econ.MarketAPI;
import com.fs.starfarer.api.impl.campaign.ids.Commodities;
import com.fs.starfarer.api.impl.campaign.ids.Conditions;
import com.fs.starfarer.api.impl.campaign.ids.Factions;
import com.fs.starfarer.api.impl.campaign.ids.Industries;
import com.fs.starfarer.api.impl.campaign.ids.Submarkets;
import data.scripts.util.II_Util;
import java.util.ArrayList;
import java.util.Arrays;

import static data.scripts.world.imperium.II_Thracia.addMarketplace;

public class II_Yma {

    public void generate(SectorAPI sector) {
        StarSystemAPI system = sector.getStarSystem("Yma");

        SectorEntityToken embassy = system.addCustomEntity("ii_embassy", "Imperial Embassy", "station_side03",
                "interstellarimperium");
        embassy.setCircularOrbitPointingDown(system.getEntityById("huascar"), 0, 300, 100);
        embassy.setInteractionImage("illustrations", "hound_hangar");
        embassy.setCustomDescriptionId("ii_station_embassy");

        MarketAPI embassyMarket = addMarketplace("interstellarimperium", embassy,
                null,
                "Imperial Embassy", 3, // 1 industry limit
                new ArrayList<>(Arrays.asList(
                        Conditions.POPULATION_3,
                        "ii_imperialdoctrine")),
                new ArrayList<>(Arrays.asList(
                        new ArrayList<>(Arrays.asList(Industries.POPULATION)),
                        new ArrayList<>(Arrays.asList(Industries.SPACEPORT)),
                        new ArrayList<>(Arrays.asList(Industries.HEAVYBATTERIES)),
                        new ArrayList<>(Arrays.asList(Industries.WAYSTATION)),
                        new ArrayList<>(Arrays.asList(Industries.PATROLHQ)),
                        new ArrayList<>(Arrays.asList("commerce")), // Industry
                        new ArrayList<>(Arrays.asList(Industries.ORBITALSTATION_MID)))),
                new ArrayList<>(Arrays.asList(
                        Submarkets.SUBMARKET_BLACK,
                        Submarkets.SUBMARKET_OPEN,
                        Submarkets.SUBMARKET_STORAGE)),
                0.3f,
                true);

        II_Util.setMarketInfluence(embassyMarket, Factions.PERSEAN);
    }
}
