package ru.trader.maddavo;

import java.util.HashMap;
import java.util.Map;

public class ItemConverter {
    private final static Map<String, String> IDS = new HashMap<>(85, 0.9f);


    static {
        IDS.put("explosives", "explosives");
        IDS.put("hydrogen fuel", "hydrogenfuel");
        IDS.put("mineral oil", "mineraloil");
        IDS.put("nerve agents", "nerve_agents");
        IDS.put("pesticides", "pesticides");
        IDS.put("surface stabilisers", "surface_stabilisers");
        IDS.put("synthetic reagents", "synthetic_reagents");
        IDS.put("clothing", "clothing");
        IDS.put("consumer technology", "consumertechnology");
        IDS.put("domestic appliances", "domesticappliances");
        IDS.put("evacuation shelter", "evacuation_shelter");
        IDS.put("algae", "algae");
        IDS.put("animal meat", "animalmeat");
        IDS.put("coffee", "coffee");
        IDS.put("energy drinks", "energydrinks");
        IDS.put("fish", "fish");
        IDS.put("food cartridges", "foodcartridges");
        IDS.put("fruit and vegetables", "fruitandvegetables");
        IDS.put("grain", "grain");
        IDS.put("synthetic meat", "syntheticmeat");
        IDS.put("tea", "tea");
        IDS.put("ceramic composites", "ceramic_composites");
        IDS.put("meta-alloys", "meta_alloys");
        IDS.put("polymers", "polymers");
        IDS.put("semiconductors", "semiconductors");
        IDS.put("superconductors", "superconductors");
        IDS.put("beer", "beer");
        IDS.put("bootleg liquor", "bootleg_liquor");
        IDS.put("liquor", "liquor");
        IDS.put("narcotics", "basicnarcotics");
        IDS.put("tobacco", "tobacco");
        IDS.put("wine", "wine");
        IDS.put("atmospheric processors", "atmosphericprocessors");
        IDS.put("building fabricators", "building_fabricators");
        IDS.put("crop harvesters", "cropharvesters");
        IDS.put("geological equipment", "geological_equipment");
        IDS.put("marine equipment", "marinesupplies");
        IDS.put("microbial furnaces", "microbialfurnaces");
        IDS.put("mineral extractors", "mineralextractors");
        IDS.put("power generators", "powergenerators");
        IDS.put("skimmer components", "skimer_components");
        IDS.put("thermal cooling units", "thermal_cooling_units");
        IDS.put("water purifiers", "waterpurifiers");
        IDS.put("agri-medicines", "agriculturalmedicines");
        IDS.put("basic medicines", "basicmedicines");
        IDS.put("combat stabilisers", "combatstabilisers");
        IDS.put("performance enhancers", "performanceenhancers");
        IDS.put("progenitor cells", "progenitorcells");
        IDS.put("aluminium", "aluminium");
        IDS.put("beryllium", "beryllium");
        IDS.put("bismuth", "bismuth");
        IDS.put("cobalt", "cobalt");
        IDS.put("copper", "copper");
        IDS.put("gallium", "gallium");
        IDS.put("gold", "gold");
//        IDS.put("hafnium 178", "");
        IDS.put("indium", "indium");
        IDS.put("lanthanum", "lanthanum");
        IDS.put("lithium", "lithium");
        IDS.put("osmium", "osmium");
        IDS.put("palladium", "palladium");
        IDS.put("platinum", "platinum");
        IDS.put("tantalum", "tantalum");
        IDS.put("silver", "silver");
        IDS.put("thallium", "thallium");
        IDS.put("thorium", "thorium");
        IDS.put("titanium", "titanium");
        IDS.put("uranium", "uranium");
        IDS.put("bauxite", "bauxite");
        IDS.put("bertrandite", "bertrandite");
        IDS.put("coltan", "coltan");
        IDS.put("cryolite", "cryolite");
        IDS.put("gallite", "gallite");
        IDS.put("goslarite", "goslarite");
        IDS.put("indite", "indite");
        IDS.put("lepidolite", "lepidolite");
//        IDS.put("moissanite", "");
        IDS.put("painite", "painite");
        IDS.put("pyrophyllite", "pyrophyllite");
        IDS.put("rutile", "rutile");
//        IDS.put("taaffeite", "");
        IDS.put("uraninite", "uraninite");
//        IDS.put("ai relics", "");
//        IDS.put("ancient artefact", "");
//        IDS.put("antiquities", "");
//        IDS.put("encrypted data storage", "");
//        IDS.put("experimental chemicals", "");
//        IDS.put("military intelligence", "");
//        IDS.put("military plans", "");
//        IDS.put("prototype tech", "");
//        IDS.put("rebel transmissions", "");
        IDS.put("sap 8 core container", "sap8corecontainer");
//        IDS.put("technical blueprints", "");
//        IDS.put("trade data", "");
        IDS.put("imperial slaves", "imperialslaves");
        IDS.put("slaves", "slaves");
        IDS.put("advanced catalysers", "advancedcatalysers");
        IDS.put("animal monitors", "animalmonitors");
        IDS.put("aquaponic systems", "aquaponicsystems");
        IDS.put("auto-fabricators", "autofabricators");
        IDS.put("bioreducing lichen", "bioreducinglichen");
        IDS.put("computer components", "computercomponents");
        IDS.put("h.e. suits", "hazardousenvironmentsuits");
        IDS.put("land enrichment systems", "landenrichmentsystems");
        IDS.put("muon imager", "mu_tom_imager");
        IDS.put("resonating separators", "resonatingseparators");
        IDS.put("robotics", "robotics");
        IDS.put("structural regulators", "structural_regulators");
        IDS.put("leather", "leather");
        IDS.put("natural fabrics", "naturalfabrics");
        IDS.put("synthetic fabrics", "syntheticfabrics");
        IDS.put("biowaste", "biowaste");
        IDS.put("chemical waste", "chemicalwaste");
        IDS.put("scrap", "scrap");
        IDS.put("battle weapons", "battleweapons");
        IDS.put("landmines", "landmines");
        IDS.put("non-lethal weapons", "nonlethalweapons");
        IDS.put("personal weapons", "personalweapons");
        IDS.put("reactive armour", "reactivearmour");

        IDS.put("Hydrogen Peroxide", "hydrogen_peroxide");
        IDS.put("Liquid Oxygen", "liquid_oxygen");
        IDS.put("Water", "water");
        IDS.put("Survival Equipment", "survival_equipment");
        IDS.put("CMM Composite", "cmm_composite");
        IDS.put("Insulating Membrane", "insulating_membrane");
        IDS.put("Emergency Power Cells", "emergency_power_cells");
        IDS.put("Exhaust Manifold", "exhaust_manifold");
        IDS.put("HN Shock Mount", "hn_shock_mount");
        IDS.put("Advanced Medicines", "advanced_medicines");
        IDS.put("Praseodymium", "praseodymium");
        IDS.put("Samarium", "samarium");
        IDS.put("Low Temperature Diamond", "low_temperature_diamond");
        IDS.put("Micro Controllers", "micro_controllers");
        IDS.put("Conductive Fabrics", "conductive_fabrics");
        IDS.put("Lithium Hydroxide", "lithium_hydroxide");
        IDS.put("Methane Clathrate", "methane_clathrate");
        IDS.put("Military Grade Fabrics", "military_grade_fabrics");
        IDS.put("Heatsink Interlink", "heatsink_interlink");
        IDS.put("Magnetic Emitter Coil", "magnetic_emitter_coil");
        IDS.put("Power Converter", "power_converter");
        IDS.put("Energy Grid Assembly", "power_grid_assembly");
        IDS.put("Bromellite", "bromellite");
        IDS.put("Methanol Monohydrate", "methanol_monohydrate_crystals");
        IDS.put("Hardware Diagnostic Sensor", "diagnostic_sensor");
        IDS.put("Medical Diagnostic Equipment", "medical_diagnostic_equipment");
        IDS.put("Reinforced Mounting Plate", "reinforced_mounting_plate");
        IDS.put("Articulation Motors", "articulation_motors");
        IDS.put("Modular Terminals", "modular_terminals");
        IDS.put("Power Transfer Conduits", "power_transfer_conduits");
        IDS.put("Radiation Baffle", "radiation_baffle");
        IDS.put("Ion Distributor", "ion_distributor");
        IDS.put("Nanobreakers", "nanobreakers");
        IDS.put("Telemetry Suite", "telemetry_suite");
        IDS.put("Jadeite", "jadeite");
        IDS.put("Moissanite", "moissanite");
        IDS.put("Taaffeite", "taaffeite");
    }

    public static String getItemId(String name){
        name = name.toLowerCase();
        String id = IDS.get(name);
        return  id != null ? id : name.replace(" ","_");
    }
}
