async importData() {
        return new Promise(async (resolve, reject) => {
            /**
             * Cultures
             */
            ui.notifications.notify("UAFMGI: Creating Journals for Cultures.");
            this.cultureComp = await compendiumUpdater("Cultures", "culture.hbs", this.cultures, {});

            let cultureLookup = this.cultures.map((culture) => {
                return {
                    id: culture.i,
                    name: culture.name,
                    journal: this.retrieveJournalByName({ type: "culture", name: culture.name }),
                };
            });

            /**
             * Provinces
             */
            ui.notifications.notify("UAFMGI: Creating Journals for Provinces.");
            this.provinceComp = await compendiumUpdater("Provinces", "province.hbs", this.provinces, {});
            let provinceLookup = this.provinces.map((province) => {
                return {
                    id: province.i,
                    name: province.name,
                    journal: this.retrieveJournalByName({ type: "province", name: province.name }),
                };
            });

            /**
             * Countries
             */
            ui.notifications.notify("UAFMGI: Creating Journals for Countries.");

            let countryData = this.countries.map((country) => {
                if (!(jQuery.isEmptyObject(country) || country.name === "Neutrals")) {
                    // TODO: Extrapolate Provinces, add Burgs?, Neighbors, Diplomacy, Campaigns?, Military?
                    let culture = cultureLookup[country.culture];
                    country.culture = culture;
                    // for i in country.provinces
                    // map to actual province
                    let provinces = country.provinces.map((provIndex) => provinceLookup[provIndex]);
                    country.selProvinces = provinces;
                }
                return country;
            });

            this.countryComp = await compendiumUpdater("Countries", "country.hbs", countryData, {
                countries: countryData,
            });
            let countryLookup = this.countries.map((country) => {
                return {
                    id: country.i,
                    name: country.name,
                    journal: this.retrieveJournalByName({ type: "country", name: country.name }),
                };
            });

            /**
             * Burgs
             */
            ui.notifications.notify("UAFMGI: Creating Journals for Burgs.");
            let burgData = this.burgs.map((burg, i) => {
                if (burg !== 0 && !jQuery.isEmptyObject(burg)) {
                    burg.culture = cultureLookup[burg.culture];
                    burg.country = countryLookup[burg.state];
                    burg.burgURL = this.generateBurgURL(burg, i);
                }
                return burg;
            });

            this.burgComp = await compendiumUpdater("Burgs", "burg.hbs", burgData, {});

            resolve();
        });
    }
/**
     * This method takes the data from memory and creates readable Journal
     * Entries out of it.
     *
     * @return {Promise}    resolve once all Foundry creations are done.
     */
This method takes the data from memory and creates readable Journal
Entries out of it.

@return {Promise}    resolve once all Foundry creations are done.
This method takes the data from memory and creates readable Journal Entries out of it . @return { Promise } resolve once all Foundry creations are done .
async importData() {
        return new Promise(async (resolve, reject) => {
            ui.notifications.notify("UAFMGI: Creating Journals for Cultures.");
            this.cultureComp = await compendiumUpdater("Cultures", "culture.hbs", this.cultures, {});
            let cultureLookup = this.cultures.map((culture) => {
                return {
                    id: culture.i,
                    name: culture.name,
                    journal: this.retrieveJournalByName({ type: "culture", name: culture.name }),
                };
            });
            ui.notifications.notify("UAFMGI: Creating Journals for Provinces.");
            this.provinceComp = await compendiumUpdater("Provinces", "province.hbs", this.provinces, {});
            let provinceLookup = this.provinces.map((province) => {
                return {
                    id: province.i,
                    name: province.name,
                    journal: this.retrieveJournalByName({ type: "province", name: province.name }),
                };
            });
            ui.notifications.notify("UAFMGI: Creating Journals for Countries.");
            let countryData = this.countries.map((country) => {
                if (!(jQuery.isEmptyObject(country) || country.name === "Neutrals")) {
                    let culture = cultureLookup[country.culture];
                    country.culture = culture;
                    let provinces = country.provinces.map((provIndex) => provinceLookup[provIndex]);
                    country.selProvinces = provinces;
                }
                return country;
            });
            this.countryComp = await compendiumUpdater("Countries", "country.hbs", countryData, {
                countries: countryData,
            });
            let countryLookup = this.countries.map((country) => {
                return {
                    id: country.i,
                    name: country.name,
                    journal: this.retrieveJournalByName({ type: "country", name: country.name }),
                };
            });
            ui.notifications.notify("UAFMGI: Creating Journals for Burgs.");
            let burgData = this.burgs.map((burg, i) => {
                if (burg !== 0 && !jQuery.isEmptyObject(burg)) {
                    burg.culture = cultureLookup[burg.culture];
                    burg.country = countryLookup[burg.state];
                    burg.burgURL = this.generateBurgURL(burg, i);
                }
                return burg;
            });
            this.burgComp = await compendiumUpdater("Burgs", "burg.hbs", burgData, {});
            resolve();
        });
    }
async importData ( ) { return new Promise ( async ( resolve , reject ) => { ui . notifications . notify ( "UAFMGI: Creating Journals for Cultures." ) ; this . cultureComp = await compendiumUpdater ( "Cultures" , "culture.hbs" , this . cultures , { } ) ; let cultureLookup = this . cultures . map ( ( culture ) => { return { id : culture . i , name : culture . name , journal : this . retrieveJournalByName ( { type : "culture" , name : culture . name } ) , } ; } ) ; ui . notifications . notify ( "UAFMGI: Creating Journals for Provinces." ) ; this . provinceComp = await compendiumUpdater ( "Provinces" , "province.hbs" , this . provinces , { } ) ; let provinceLookup = this . provinces . map ( ( province ) => { return { id : province . i , name : province . name , journal : this . retrieveJournalByName ( { type : "province" , name : province . name } ) , } ; } ) ; ui . notifications . notify ( "UAFMGI: Creating Journals for Countries." ) ; let countryData = this . countries . map ( ( country ) => { if ( ! ( jQuery . isEmptyObject ( country ) || country . name === "Neutrals" ) ) { let culture = cultureLookup [ country . culture ] ; country . culture = culture ; let provinces = country . provinces . map ( ( provIndex ) => provinceLookup [ provIndex ] ) ; country . selProvinces = provinces ; } return country ; } ) ; this . countryComp = await compendiumUpdater ( "Countries" , "country.hbs" , countryData , { countries : countryData , } ) ; let countryLookup = this . countries . map ( ( country ) => { return { id : country . i , name : country . name , journal : this . retrieveJournalByName ( { type : "country" , name : country . name } ) , } ; } ) ; ui . notifications . notify ( "UAFMGI: Creating Journals for Burgs." ) ; let burgData = this . burgs . map ( ( burg , i ) => { if ( burg !== 0 && ! jQuery . isEmptyObject ( burg ) ) { burg . culture = cultureLookup [ burg . culture ] ; burg . country = countryLookup [ burg . state ] ; burg . burgURL = this . generateBurgURL ( burg , i ) ; } return burg ; } ) ; this . burgComp = await compendiumUpdater ( "Burgs" , "burg.hbs" , burgData , { } ) ; resolve ( ) ; } ) ; }
This method takes the data from memory and creates readable Journal
 Entries out of it.
This method takes the data from memory and creates readable Journal Entries out of it .
/**
             * Cultures
             */ /**
             * Provinces
             */ /**
             * Countries
             */ // TODO: Extrapolate Provinces, add Burgs?, Neighbors, Diplomacy, Campaigns?, Military? // for i in country.provinces // map to actual province /**
             * Burgs
             */