Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Commit

Permalink
Pop creation function now has access to the old province and old coun…
Browse files Browse the repository at this point in the history
…try to look up info.
  • Loading branch information
Idhrendur committed Apr 9, 2011
1 parent 1be5b8b commit 4e1acd6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 139 deletions.
128 changes: 0 additions & 128 deletions cpp_version/EU3toV2Converter/DW_cultureMap.txt

This file was deleted.

13 changes: 13 additions & 0 deletions cpp_version/EU3toV2Converter/EU3World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ vector<EU3Country> 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++)
Expand Down
1 change: 1 addition & 0 deletions cpp_version/EU3toV2Converter/EU3World.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class EU3World {
public:
void init(Object* obj);
vector<EU3Country> getCountries();
EU3Country* getCountry(string);
EU3Province* getProvince(int provNum);
void removeCountry(string tag);
private:
Expand Down
17 changes: 9 additions & 8 deletions cpp_version/EU3toV2Converter/V2Province.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion cpp_version/EU3toV2Converter/V2Province.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "tempFuncs.h"
#include "V2Pop.h"
#include "EU3Province.h"
#include "EU3Country.h"
using namespace std;

class V2Province {
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions cpp_version/EU3toV2Converter/V2World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down

0 comments on commit 4e1acd6

Please sign in to comment.