From 4e1acd6798979913055d26e08259e7402ba09d4e Mon Sep 17 00:00:00 2001 From: idhrendur Date: Sat, 9 Apr 2011 18:35:11 +0000 Subject: [PATCH] Pop creation function now has access to the old province and old country to look up info. --- .../EU3toV2Converter/DW_cultureMap.txt | 128 ------------------ cpp_version/EU3toV2Converter/EU3World.cpp | 13 ++ cpp_version/EU3toV2Converter/EU3World.h | 1 + cpp_version/EU3toV2Converter/V2Province.cpp | 17 +-- cpp_version/EU3toV2Converter/V2Province.h | 3 +- cpp_version/EU3toV2Converter/V2World.cpp | 4 +- 6 files changed, 27 insertions(+), 139 deletions(-) delete mode 100644 cpp_version/EU3toV2Converter/DW_cultureMap.txt diff --git a/cpp_version/EU3toV2Converter/DW_cultureMap.txt b/cpp_version/EU3toV2Converter/DW_cultureMap.txt deleted file mode 100644 index 187c23b8d..000000000 --- a/cpp_version/EU3toV2Converter/DW_cultureMap.txt +++ /dev/null @@ -1,128 +0,0 @@ -# This culture map contains one to one and many to one culture conversions. - -cultureMap = { - -link = { vic = north_german eu3 = pommeranian eu3 = prussian eu3 = hannoverian eu3 = saxon } -link = { vic = south_german eu3 = hessian eu3 = bavarian eu3 = austrian eu3 = rheinlaender } -link = { vic = dutch eu3 = dutch } -link = { vic = flemish eu3 = flemish } -link = { vic = wallonian eu3 = wallonian } -link = { vic = swedish eu3 = swedish } -link = { vic = danish eu3 = danish } -link = { vic = norwegian eu3 = norwegian eu3 = sapmi } -link = { vic = finnish eu3 = finnish eu3 = ingrian eu3 = karelian } -link = { vic = british eu3 = english eu3 = scottish eu3 = welsh eu3 = breton } -link = { vic = irish eu3 = irish } -link = { vic = north_italian eu3 = lombard eu3 = umbrian } -link = { vic = south_italian eu3 = sicilian } -link = { vic = maltese eu3 = maltese } -link = { vic = basque eu3 = basque } -link = { vic = spanish eu3 = castillian eu3 = galician eu3 = andalucian } -link = { vic = catalan eu3 = catalan } -link = { vic = portuguese eu3 = portugese } -link = { vic = french eu3 = cosmopolitan_french eu3 = gascon eu3 = normand eu3 = aquitaine eu3 = burgundian eu3 = occitain } -link = { vic = croat eu3 = croatian } -link = { vic = serb eu3 = serbian } -link = { vic = bulgarian eu3 = bulgarian } -link = { vic = albanian eu3 = albanian } -link = { vic = romanian eu3 = romanian } -link = { vic = hungarian eu3 = hungarian } -link = { vic = polish eu3 = polish eu3 = schlesian } -link = { vic = czech eu3 = czech } -link = { vic = russian eu3 = russian eu3 = uralic eu3 = ruthenian} -link = { vic = byelorussian eu3 = byelorussian } -link = { vic = lithuanian eu3 = lithuanian } -link = { vic = latvian eu3 = latvian eu3 = old_prussian } -link = { vic = estonian eu3 = estonian } -link = { vic = greek eu3 = greek } -link = { vic = georgian eu3 = georgian } -link = { vic = armenian eu3 = armenian } -link = { vic = maghrebi eu3 = maghreb_arabic } -link = { vic = misri eu3 = al_misr_arabic eu3 = al_suryah_arabic } -link = { vic = mashriqi eu3 = al_iraqiya_arabic } -link = { vic = bedouin eu3 = bedouin_arabic } -link = { vic = berber eu3 = berber } -link = { vic = turkish eu3 = turkish } -link = { vic = azerbaijani eu3 = azerbadjani } -link = { vic = persian eu3 = persian eu3 = east_persian eu3 = baluchi } -link = { vic = uzbek eu3 = uzbehk } -link = { vic = kazak eu3 = khazak } -link = { vic = kirgiz eu3 = kirgiz } -link = { vic = turkmen eu3 = turkmeni } -link = { vic = tatar eu3 = tartar } -link = { vic = mongol eu3 = mongol } -link = { vic = siberian eu3 = siberian } -link = { vic = yakut eu3 = yakut } -link = { vic = tibetan eu3 = tibetan } -link = { vic = assamese eu3 = assamese } -link = { vic = bengali eu3 = bengali } -link = { vic = bihari eu3 = bihari } -link = { vic = nepali eu3 = nepali } -link = { vic = oriya eu3 = oriya } -link = { vic = sinhala eu3 = sinhala } -link = { vic = avadhi eu3 = avadhi } -link = { vic = kanauji eu3 = kanauji } -link = { vic = panjabi eu3 = panjabi } -link = { vic = kashmiri eu3 = kashmiri } -link = { vic = gujarati eu3 = gujarati } -link = { vic = marathi eu3 = marathi } -link = { vic = sindi eu3 = sindhi } -link = { vic = rajput eu3 = rajput } -link = { vic = kannada eu3 = kannada } -link = { vic = malayalam eu3 = malayalam } -link = { vic = tamil eu3 = tamil } -link = { vic = telegu eu3 = telegu } -link = { vic = vietnamese eu3 = vietnamese } -link = { vic = khmer eu3 = khmer } -link = { vic = malay eu3 = malayan } -link = { vic = filipino eu3 = filipino } -link = { vic = moluccan eu3 = moluccan } -link = { vic = thai eu3 = central_thai eu3 = northern_thai } -link = { vic = lao eu3 = lao } -link = { vic = shan eu3 = shan } -link = { vic = burmese eu3 = burmese } -link = { vic = asian_minor eu3 = mon eu3 = cham eu3 = sulawesi eu3 = chin } -link = { vic = japanese eu3 = japanese } -link = { vic = manchu eu3 = manchu } -link = { vic = beifaren eu3 = chihan } -link = { vic = nanfaren eu3 = cantonese } -link = { vic = korean eu3 = korean } -link = { vic = polynesian eu3 = polynesian eu3 = papuan } -link = { vic = aborigine eu3 = aboriginal } -link = { vic = melanesian eu3 = melanesian eu3 = madagascan } -link = { vic = zapotec eu3 = zapotek } -link = { vic = mayan eu3 = mayan } -link = { vic = nahua eu3 = aztek } -link = { vic = tarascan eu3 = inca } -link = { vic = guarani eu3 = guarani } -link = { vic = aimara eu3 = aimara } -link = { vic = amazonian eu3 = amazonian } -link = { vic = patagonian eu3 = patagonian } -link = { vic = guajiro eu3 = guajiro } -link = { vic = tupinamba eu3 = tupinamba } -link = { vic = metis eu3 = iroquis eu3 = huron eu3 = shawnee eu3 = creek } -link = { vic = dakota eu3 = dakota } -link = { vic = cherokee eu3 = cherokee } -link = { vic = pueblo eu3 = pueblo } -link = { vic = inuit eu3 = inuit } -link = { vic = cree eu3 = cree } -link = { vic = navajo eu3 = navajo } -link = { vic = native_american_minor eu3 = arawak eu3 = carib eu3 = teremembe eu3 = mataco eu3 = aleutian eu3 = delaware } -link = { vic = yankee eu3 = american } -link = { vic = akan eu3 = aka eu3 = ashanti } -link = { vic = bambara eu3 = mali } -link = { vic = dyula deu3 = yola } -link = { vic = tuareg eu3 = tuareg } -link = { vic = yoruba eu3 = yorumba } -link = { vic = bakongo eu3 = kongolese } -link = { vic = african_minor eu3 = madagasque eu3 = senegambian eu3 = bantu } -link = { vic = oromo eu3 = ethiopian } -link = { vic = somali eu3 = somali } -link = { vic = sudanese eu3 = nubian } -link = { vic = swahili eu3 = swahili } -link = { vic = shona eu3 = shona } - - -} - - diff --git a/cpp_version/EU3toV2Converter/EU3World.cpp b/cpp_version/EU3toV2Converter/EU3World.cpp index 855bde338..f82e32a54 100644 --- a/cpp_version/EU3toV2Converter/EU3World.cpp +++ b/cpp_version/EU3toV2Converter/EU3World.cpp @@ -51,6 +51,19 @@ vector EU3World::getCountries() } +EU3Country* EU3World::getCountry(string tag) +{ + for (unsigned int i = 0; i < countries.size(); i++) + { + if (countries[i].getTag() == tag) + { + return &(countries[i]); + } + } + return NULL; +} + + EU3Province* EU3World::getProvince(int provNum) { for (unsigned int i = 0; i < provinces.size(); i++) diff --git a/cpp_version/EU3toV2Converter/EU3World.h b/cpp_version/EU3toV2Converter/EU3World.h index 87661f8d8..0cd1e2f72 100644 --- a/cpp_version/EU3toV2Converter/EU3World.h +++ b/cpp_version/EU3toV2Converter/EU3World.h @@ -12,6 +12,7 @@ class EU3World { public: void init(Object* obj); vector getCountries(); + EU3Country* getCountry(string); EU3Province* getProvince(int provNum); void removeCountry(string tag); private: diff --git a/cpp_version/EU3toV2Converter/V2Province.cpp b/cpp_version/EU3toV2Converter/V2Province.cpp index 44116ebd1..39dc83d1f 100644 --- a/cpp_version/EU3toV2Converter/V2Province.cpp +++ b/cpp_version/EU3toV2Converter/V2Province.cpp @@ -78,7 +78,7 @@ string V2Province::getOwner() } -void V2Province::createPops(EU3Province* oldProvince) +void V2Province::createPops(EU3Province* oldProvince, EU3Country* oldCountry) { int farmers = 0; int labourers = 0; @@ -103,11 +103,12 @@ void V2Province::createPops(EU3Province* oldProvince) craftsmen += 5; } - //If Nation has Slavery ALLOWED, add 5 SLAVES. + if (true) //If Nation has Slavery ALLOWED, add 5 SLAVES. Assumed true for now + { + slaves += 5; + } soldiers += 2; - //If province has a MANUFACTORY add 2 CRAFTSMEN - //If province has a MANUFACTORY add 1 clerk. - if(0) + if(0) //If province has a MANUFACTORY { craftsmen += 2; clerks += 1; @@ -116,12 +117,12 @@ void V2Province::createPops(EU3Province* oldProvince) clergymen += 1; officers += 1; //If province is the CAPITAL or NATIONAL FOCUS add 1 BUREAUCRAT + //If province is capital or was national focus, add 1 ARISTOCRATS. //If province is CENTER OF TRADE then add 1 CLERK + //If province was a COT, add 1 CAPITALISTS. //If government is NOT republic, add 2 ARISTOCRATS. //If government is NOT absolute monarchy, add 2 CAPITALISTS. - //If province is capital or was national focus, add 1 ARISTOCRATS. - //If province was a COT, add 1 CAPITALISTS. - aristocrats += 1; + aristocrats += 1; // temporary for now int total = farmers + labourers + slaves + soldiers + craftsmen + artisans + clergymen + clerks + bureaucrats + officers + capitalists + aristocrats; diff --git a/cpp_version/EU3toV2Converter/V2Province.h b/cpp_version/EU3toV2Converter/V2Province.h index 4f2a894dc..f4322ce68 100644 --- a/cpp_version/EU3toV2Converter/V2Province.h +++ b/cpp_version/EU3toV2Converter/V2Province.h @@ -7,6 +7,7 @@ #include "tempFuncs.h" #include "V2Pop.h" #include "EU3Province.h" +#include "EU3Country.h" using namespace std; class V2Province { @@ -18,7 +19,7 @@ class V2Province { void setColonial(bool); void setCulture(string); bool isColonial(); - void createPops(EU3Province* oldProvince); + void createPops(EU3Province* oldProvince, EU3Country* oldCountry); void output(FILE*); private: bool land; diff --git a/cpp_version/EU3toV2Converter/V2World.cpp b/cpp_version/EU3toV2Converter/V2World.cpp index a0e6d85f4..6787614dd 100644 --- a/cpp_version/EU3toV2Converter/V2World.cpp +++ b/cpp_version/EU3toV2Converter/V2World.cpp @@ -188,8 +188,8 @@ void V2World::convertProvinces(EU3World sourceWorld, provinceMapping provMap, co log("Error: Could not set culture for province %d\n", destNum); provinces[i].setCulture(""); } - - provinces[i].createPops(oldProvince); + sourceWorld.getCountry(oldOwner); + provinces[i].createPops(oldProvince, sourceWorld.getCountry(oldOwner)); } } }