001package com.fs.starfarer.api.plugins;
002
003import java.util.Map;
004
005import com.fs.starfarer.api.campaign.CampaignFleetAPI;
006import com.fs.starfarer.api.campaign.PlanetAPI;
007import com.fs.starfarer.api.campaign.econ.MarketConditionAPI;
008import com.fs.starfarer.api.combat.MutableStat;
009import com.fs.starfarer.api.impl.campaign.ids.Conditions;
010import com.fs.starfarer.api.impl.campaign.procgen.themes.DerelictThemeGenerator;
011
012public interface SurveyPlugin {
013        void init(CampaignFleetAPI fleet, PlanetAPI planet);
014        
015        Map<String, Integer> getRequired();
016        Map<String, Integer> getConsumed();
017        
018        String getImageCategory();
019        String getImageKey();
020
021        MutableStat getCostMult();
022
023        /**
024         * Total XP.
025         * @return
026         */
027        long getXP();
028        
029        
030        /**
031         * XP for a specific condition.
032         * @param conditionId
033         * @return
034         */
035        long getBaseXPForCondition(String conditionId);
036        
037        
038        /**
039         * Overall XP multipliers, based on hazard level/planet size/etc.
040         * @return
041         */
042        MutableStat getXPMult();
043        
044        String getSurveyDataType(PlanetAPI planet);
045        
046        default int getSurveyDataScore(PlanetAPI planet) {
047                if (planet.getMarket() == null) return 0;
048                int count = 0;
049                float value = 0;
050                for (MarketConditionAPI mc : planet.getMarket().getConditions()) {
051                        if (DerelictThemeGenerator.interestingConditionsWithRuins.contains(mc.getId())) {
052                                count++;
053                        }
054                        if (mc.getGenSpec() != null) {
055                                //value += mc.getGenSpec().getXpMult();
056                                value += mc.getGenSpec().getRank();
057                        }
058                }
059                
060                if (planet.getMarket().hasCondition(Conditions.HABITABLE)) {
061                        value += 4f;
062                }
063                
064                float hazard = planet.getMarket().getHazardValue();
065                value -= (hazard - 1f) * 2f;
066                
067                return (int) value;
068        };
069
070        Map<String, Integer> getOutpostConsumed();
071        
072}