Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <sstream>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- //Escape add
- float random(float x);
- //Global
- //Inventory
- int potInv = 0, oilInv = 0, fishInv = 0, woolInv = 0, velvetInv = 0, toolsInv = 0, spiceInv = 0, ironInv = 0, flourInv = 0, dyeInv = 0, leatherInv = 0, furInv = 0, beerInv = 0, saltInv = 0, wineInv = 0;
- int qty = 0; //quantity
- int inv = 0;
- //User
- float balance = 1000;
- //Trade Goods Prices, in order: Sweden, Poland, Russia
- //Escape-add;
- float x;
- float randomnum = random(x);
- float potPrice[7] = {90, 157.5, 157.5, 99, 67.5, 99, 90};
- float oilPrice[7] = {400, 300, 700, 700, 440, 440, 400};
- float fishPrice[7] = {50, 55, 87.5, 55, 87.5, 55, 50};
- float woolPrice[7] = {240, 180, 180, 264, 264, 264, 240};
- float velvetPrice[7] = {950, 1662.5, 1662.5, 990, 712.5, 990, 950};
- float toolsPrice[7] = {400, 300, 700, 440, 440, 400};
- float spicePrice[7] = {800, 1400, 600, 880, 600, 880, 800};
- float ironPrice[7] = {220, 365, 365, 365, 165, 242, 220};
- float flourPrice[7] = {50, 37.5, 87.5, 55, 87.5, 55, 50};
- float dyePrice[7] = {180, 198, 135, 198, 198, 198, 180};
- float leatherPrice[7] = {180, 198, 315, 135, 135, 198, 180};
- float furPrice[7] = {390, 429, 292.5, 429, 429, 429, 390};
- float beerPrice[7] = {100, 75, 175, 175, 175, 110, 100};
- float saltPrice[7] = {220, 165, 385, 165, 165, 242, 220};
- float winePrice[7] = {200, 220, 150, 220, 220, 220, 200};
- float price;
- float priceArrays[100];
- //Country Mem
- string country = "None"; //Starting
- string place[7] = { "Sweden", "Poland", "Russia", "Crimea", "Saudi", "Ukraine", "China" };
- int land; //index
- //Country Inv (Default inv)
- //surplus 200%;
- //well-met 100%;
- //high 75%; med 50%; low 25%;
- int potInvSwede = 150, potInvPol = 50, potInvRus = 75, potInvCri = 75, potInvSau = 150, potInvUkr = 75, potInvChi = 100; //well 100
- int oilInvSwede = 25, oilInvPol = 75, oilInvRus = 25, oilInvCri = 25, oilInvSau = 38, oilInvUkr = 38, oilInvChi = 50; //well 50
- //additional goods
- int fishInvSwede = 150, fishInvPol = 113, fishInvRus = 75, fishInvCri= 113, fishInvSau = 75, fishInvUkr = 113, fishInvChi = 150; //well 75
- int woolInvSwede = 75, woolInvPol = 56, woolInvRus = 113, woolInvCri= 56, woolInvSau = 56, woolInvUkr = 56, woolInvChi=75; //well 75
- int velvetInvSwede =25, velvetInvPol = 13, velvetInvRus = 13, velvetInvCri = 19, velvetInvSau=38, velvetInvUkr = 19, velvetInvChi=25; //well 25
- int toolsInvSwede = 50, toolsInvPol = 75, toolsInvRus = 38, toolsInvCri=38, toolsInvSau=38, toolsInvUkr = 38, toolsInvChi=50; //well 50
- int spiceInvSwede = 30, spiceInvPol = 15, spiceInvRus = 45, spiceInvCri= 23, spiceInvSau= 23, spiceInvUkr = 23, spiceInvChi=30; //well 30
- int ironInvSwede = 100, ironInvPol = 50, ironInvRus = 50, ironInvCri= 50, ironInvSau=75, ironInvUkr = 75, ironInvChi = 100; //well 100
- int flourInvSwede = 150, flourInvPol = 113, flourInvRus = 75, flourInvCri= 113, flourInvSau= 75, flourInvUkr = 113, flourInvChi = 150; //well 150
- int dyeInvSwede = 75, dyeInvPol = 56, dyeInvRus= 113, dyeInvCri = 56, dyeInvSau= 56, dyeInvUkr = 56, dyeInvChi = 75; //well 75
- int leatherInvSwede = 75, leatherInvPol = 56, leatherInvRus = 38, leatherInvCri = 113, leatherInvSau=56, leatherInvUkr = 56, leatherInvChi = 75; //well 75
- int furInvSwede = 75, furInvPol = 56, furInvRus = 113, furInvCri = 56, furInvSau=56, furInvUkr = 56, furInvChi = 75; //well 75
- int beerInvSwede =75, beerInvPol = 113, beerInvRus = 56, beerInvCri = 38, beerInvSau=38, beerInvUkr = 56, beerInvChi = 75; //well 75
- int saltInvSwede =75, saltInvPol = 38, saltInvRus = 56, saltInvCri = 113, saltInvSau=113, saltInvUkr = 56, saltInvChi = 75; //well 75
- int wineInvSwede =75, wineInvPol = 56, wineInvRus = 56, wineInvCri = 113, wineInvSau=56, wineInvUkr = 56, wineInvChi = 75; //well 75
- int inv_Country = 0;
- //Goods
- string tradeGoods[15] = { "Pottery ", "Oil ", "Fish ", "Wool Cloth ", "Velvet " , "Tools ", "Spices", "Iron", "Flour", "Dyes", "Leatherworks", "Fur", "Beer" , "Salt", "Wine" };
- int goodNo;
- int goodType;
- //int remember strings
- int mem = 0; //inv
- int mem2 = 0; //notes
- int mem3 = 0; //buy/sell
- //End of Global
- //Escape add
- void random(void);
- //What do I do first?
- void loc(void);
- //User's Inventory
- void check(void);
- //Trade
- void trade(void);
- //Buy function
- void buy(void);
- //traded
- void traded(void);
- //Quantity function
- void quantity(void);
- //lack function
- void lack(void);
- //Sell function
- void sell(void);
- //Goods function
- void goods(void);
- //Notes function
- void notes(void);
- //Balance function
- void balance_balance(void);
- //todo
- void todo(void);
- void todo2(void);
- //Country Inventory
- void countryInv(void);
- void determineCountry(void);
- main(){
- loc();
- }
- //loc function
- void loc(void){
- country = "None";
- string input;
- int x = 0;
- mem = 0;
- mem2 = 0;
- cout << endl;
- cout << endl;
- cout << "Balance: Eur " << balance;
- cout << endl;
- cout << "What do you want to do?";
- cout << endl;
- cout << "[1] Trade";
- cout << endl;
- cout << "[2] Check Inventory";
- cout << endl;
- do {
- cout << "Enter Input: ";
- cin >> input;
- stringstream(input) >> x;
- switch (x)
- {
- case 1:
- trade();
- break;
- case 2:
- check();
- break;
- default:
- cout << "That's an invalid option. Please try again.";
- }
- cout << endl;
- } while (input != "1" || input != "2");
- }
- //check function
- void check(void){
- cout << endl;
- cout << "You currently have:";
- cout << endl;
- cout << potInv << " Pottery";
- cout << endl;
- cout << oilInv << " Oil";
- cout << endl;
- //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
- cout << fishInv << " Fish";
- cout << endl;
- cout << woolInv << " Wool Cloth";
- cout << endl;
- cout << velvetInv << " Velvet";
- cout << endl;
- cout << toolsInv << " Tools";
- cout << endl;
- cout << spiceInv << " Spice";
- cout << endl;
- cout << ironInv << " Iron";
- cout << endl;
- cout << flourInv << " Flour";
- cout << endl;
- cout << dyeInv << " Dye";
- cout << endl;
- cout << leatherInv << " Leatherworks";
- cout << endl;
- cout << furInv << " Fur";
- cout << endl;
- cout << beerInv << " Beer";
- cout << endl;
- cout << saltInv << " Salt";
- cout << endl;
- cout << wineInv << " Wine";
- cout << endl;
- cout << " ...in your inventory.";
- cout << endl;
- system("pause");
- switch (mem){
- case 0:
- loc();
- break;
- case 1:
- trade();
- break;
- case 2:
- buy();
- break;
- case 3:
- sell();
- break;
- case 4:
- todo2();
- break;
- }
- }
- //trade function
- void trade(void){
- mem = 1;
- string input;
- country = "None";
- mem2 = 1;
- int x;
- cout << endl;
- cout << "Country List: ";
- cout << endl;
- //string place[7] = { "Sweden", "Poland", "Russia", "Crimea", "Saudi", "Ukraine", "China" };
- cout << "[1] " << "Sweden";
- cout << endl;
- cout << "[2] " << "Poland";
- cout << endl;
- cout << "[3] " << "Russia";
- cout << endl;
- cout << "[4] " << "Crimea";
- cout << endl;
- cout << "[5] " << "Saudi Arabia";
- cout << endl;
- cout << "[6] " << "Ukraine";
- cout << endl;
- cout << "[7] " << "China";
- cout << endl;
- cout << "[8] " << "Check inventory";
- cout << endl;
- cout << "[9] " << "Check notes";
- cout << endl;
- cout << "[10] " << "Return";
- cout << endl;
- do {
- cout << "Enter Input: ";
- cin >> input;
- stringstream(input) >> x;
- switch (x){
- case 1:
- land = 0; // Sweden
- todo();
- break;
- case 2:
- land = 1; // Poland
- todo();
- break;
- case 3:
- land = 2; // Russia
- todo();
- break;
- case 4:
- land = 3; // Crimea
- todo();
- break;
- case 5:
- land = 4; // Saudi
- todo();
- break;
- case 6:
- land = 5; // Ukraine
- todo();
- break;
- case 7:
- land = 6; // China
- todo();
- break;
- case 8:
- check();
- break;
- case 9:
- notes();
- break;
- case 10:
- loc();
- break;
- default:
- cout << "That's an invalid option. Please try again.";
- cout << endl;
- break;
- }
- cout << endl;
- } while (input != "1" || input != "2" || input != "3" || input != "4" || input != "5" || input != "6" || input != "7" || input !="8" || input != "9" || input != "10"); // req improvement
- }
- //goods function
- void goods(void){
- cout << setprecision(2) << fixed;
- cout << endl;
- random();
- cout << "[17] " << "Check inventory";
- cout << endl;
- cout << "[18] " << "Check notes";
- cout << endl;
- cout << "[19] " << "Return";
- cout << endl;
- }
- //buy function
- void buy(void){
- string input;
- int x;
- mem = 2;
- mem2 = 2;
- mem3 = 0;
- if (land == 0){
- cout << endl;
- cout << "You are trading with Sweden . . . ";
- cout << endl;
- }
- else if (land == 1){
- cout << endl;
- cout << "You are trading with Poland . . . ";
- cout << endl;
- }
- else if (land == 2){
- cout << endl;
- cout << "You are trading with Russia . . . ";
- cout << endl;
- }
- else if (land == 3){
- cout << endl;
- cout << "You are trading with Crimea . . . ";
- cout << endl;
- }
- else if (land == 4){
- cout << endl;
- cout << "You are trading with Saudi Arabia . . . ";
- cout << endl;
- }
- else if (land == 5){
- cout << endl;
- cout << "You are trading with Ukraine . . . ";
- cout << endl;
- }
- else if (land == 6){
- cout << endl;
- cout << "You are trading with China . . . ";
- cout << endl;
- }
- country = "None";
- balance_balance();
- goods();
- cout << "What do you want to buy? ";
- cout << endl;
- cout << "Options: ";
- cin >> input;
- stringstream(input) >> x;
- switch (x){
- case 1:
- goodType = 0;
- determineCountry();
- inv = potInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 2:
- goodType = 1;
- determineCountry();
- inv = oilInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 3:
- goodType = 2;
- determineCountry();
- inv = fishInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 4:
- goodType = 3;
- determineCountry();
- inv = woolInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 5:
- goodType = 4;
- determineCountry();
- inv = velvetInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 6:
- goodType = 5;
- determineCountry();
- inv = velvetInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 7:
- goodType = 6;
- determineCountry();
- inv = toolsInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
- case 8:
- goodType = 7;
- determineCountry();
- inv = spiceInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 9:
- goodType = 8;
- determineCountry();
- inv = ironInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 10:
- goodType = 9;
- determineCountry();
- inv = flourInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 11:
- goodType = 10;
- determineCountry();
- inv = dyeInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 12:
- goodType = 11;
- determineCountry();
- inv = leatherInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 13:
- goodType = 12;
- determineCountry();
- inv = furInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 14:
- goodType = 13;
- determineCountry();
- inv = beerInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 15:
- goodType = 13;
- determineCountry();
- inv = saltInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 16:
- goodType = 15;
- determineCountry();
- inv = wineInv;
- price = priceArrays[goodType];
- quantity();
- if (balance < qty *price){
- lack();
- break;
- }
- else if (balance >= qty *price){
- traded();
- break;
- }
- case 17:
- check();
- break;
- case 18:
- notes();
- break;
- case 19:
- trade();
- break;
- default:
- buy();
- cout << endl;
- }
- }
- //traded function
- void traded(void){
- cout << setprecision(2) << fixed;
- if (mem3 == 0){ //buy
- balance -= qty * price;
- balance_balance();
- cout << endl;
- cout << "You bought " << tradeGoods[goodType] << "for Eur " << qty * price << ".";
- cout << endl;
- if (goodType==0) potInv+=qty;
- else if (goodType==1) oilInv+=qty;
- else if (goodType==2) fishInv+=qty;
- else if (goodType==3) woolInv+=qty;
- else if (goodType==4) velvetInv+=qty;
- else if (goodType==5) toolsInv+=qty;
- else if (goodType==6) spiceInv+=qty;
- else if (goodType==7) ironInv+=qty;
- else if (goodType==8) flourInv+=qty;
- else if (goodType==9) dyeInv+=qty;
- else if (goodType==10) leatherInv+=qty;
- else if (goodType==11) furInv+=qty;
- else if (goodType==12) beerInv+=qty;
- else if (goodType==13) saltInv+=qty;
- else if (goodType==14) wineInv+=qty;
- system("pause");
- loc();
- }
- else if (mem3 == 1){ //sell
- balance += qty * price;
- balance_balance();
- cout << endl;
- cout << "You sold " << tradeGoods[goodType] << " for Eur " << qty * price << ".";
- cout << endl;
- if (goodType==0) potInv-=qty;
- else if (goodType==1) oilInv-=qty;
- else if (goodType==1) oilInv-=qty;
- else if (goodType==2) fishInv-=qty;
- else if (goodType==3) woolInv-=qty;
- else if (goodType==4) velvetInv-=qty;
- else if (goodType==5) toolsInv-=qty;
- else if (goodType==6) spiceInv-=qty;
- else if (goodType==7) ironInv-=qty;
- else if (goodType==8) flourInv-=qty;
- else if (goodType==9) dyeInv-=qty;
- else if (goodType==10) leatherInv-=qty;
- else if (goodType==11) furInv-=qty;
- else if (goodType==12) beerInv-=qty;
- else if (goodType==13) saltInv-=qty;
- else if (goodType==14) wineInv-=qty;
- cout << endl;
- system("pause");
- loc();
- }
- }
- //quantity function
- void quantity(void){
- mem = 4;
- balance_balance();
- if (mem3 == 0){
- cout << "How many " << tradeGoods[goodType] << " do you want to buy? ";
- cin >> qty;
- countryInv();
- }
- else if (mem3 == 1){
- cout << "How many " << tradeGoods[goodType] << " do you want to sell? ";
- cin >> qty;
- countryInv();
- }
- else quantity();
- }
- //lacking function
- void lack(void){
- if (mem3 == 0){
- cout << endl;
- cout << "You have insufficient balance . . . ";
- cout << endl;
- system("pause");
- buy();
- }
- else if (mem3 == 1){
- cout << endl;
- cout << "You don't have " << qty << " of " << tradeGoods[goodType];
- cout << endl;
- system("pause");
- sell();
- }
- }
- //sell function
- void sell(void){
- string input;
- int x;
- mem = 3;
- mem2 = 3;
- mem3 = 1;
- country = "None";
- balance_balance();
- goods();
- cout << "What do you want to sell? ";
- cout << endl;
- cout << "Options: ";
- cin >> input;
- stringstream(input) >> x;
- switch (x){
- case 1:
- goodType = 0;
- determineCountry();
- inv = potInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 2:
- goodType = 1;
- determineCountry();
- inv = oilInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 3:
- goodType = 2;
- determineCountry();
- inv = fishInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 4:
- goodType = 3;
- determineCountry();
- inv = woolInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 5:
- goodType = 4;
- determineCountry();
- inv = velvetInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 6:
- goodType = 5;
- determineCountry();
- inv = velvetInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 7:
- goodType = 6;
- determineCountry();
- inv = toolsInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 8:
- goodType = 7;
- determineCountry();
- inv = spiceInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 9:
- goodType = 8;
- determineCountry();
- inv = ironInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 10:
- goodType = 9;
- determineCountry();
- inv = flourInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 11:
- goodType = 10;
- determineCountry();
- inv = dyeInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 12:
- goodType = 11;
- determineCountry();
- inv = leatherInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 13:
- goodType = 12;
- determineCountry();
- inv = furInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 14:
- goodType = 13;
- determineCountry();
- inv = beerInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 15:
- goodType = 13;
- determineCountry();
- inv = saltInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 16:
- goodType = 15;
- determineCountry();
- inv = wineInv;
- price = priceArrays[goodType];
- quantity();
- if (inv < qty){
- lack();
- break;
- }
- else if (inv >= qty){
- traded();
- break;
- }
- case 17:
- check();
- break;
- case 18:
- notes();
- break;
- case 19:
- trade();
- break;
- default:
- sell();
- }
- }
- //notes function
- void notes(void){
- if (country == "Sweden"){
- cout << endl;
- cout << "Sweden's exports and imports are well-met . . . ";
- cout << endl;
- //For checking . . .
- cout << "Sweden's Inventory . . . ";
- cout << endl;
- cout << "Pottery: " << potInvSwede;
- cout << endl;
- cout << "Oil: " << oilInvSwede;
- cout << endl;
- cout << "Fish: " << fishInvSwede;
- cout << endl;
- cout << "Wool Cloth:" << woolInvSwede;
- cout << endl;
- cout << "Velvet: " << velvetInvSwede;
- cout << endl;
- cout << "Tools: " << toolsInvSwede;
- cout << endl;
- cout << "Spice: " << spiceInvSwede;
- cout << endl;
- cout << "Iron: " << ironInvSwede;
- cout << endl;
- cout << "Flour: " << flourInvSwede;
- cout << endl;
- cout << "Dyes: " << dyeInvSwede;
- cout << endl;
- cout << "Leatherworks: " << leatherInvSwede;
- cout << endl;
- cout << "Fur: " << furInvSwede;
- cout << endl;
- cout << "Beer: " << beerInvSwede;
- cout << endl;
- cout << "Salt: " << saltInvSwede;
- cout << endl;
- cout << "Wine: " << wineInvSwede;
- cout << endl;
- }
- else if (country == "Poland"){
- cout << endl;
- cout << "Poland's Exports and Imports . . . ";
- cout << endl;
- cout << "Exports: Oil, Beer, Flour, Tools";
- cout << endl;
- cout << "Imports: Velvet, Iron, Spice, Pottery";
- cout << endl;
- // Checking . . .
- cout << "Poland's Inventory . . . ";
- cout << endl;
- cout << "Pottery: " << potInvPol;
- cout << endl;
- cout << "Oil: " << oilInvPol;
- cout << endl;
- cout << "Fish: " << fishInvPol;
- cout << endl;
- cout << "Wool Cloth:" << woolInvPol;
- cout << endl;
- cout << "Velvet: " << velvetInvPol;
- cout << endl;
- cout << "Tools: " << toolsInvPol;
- cout << endl;
- cout << "Spice: " << spiceInvPol;
- cout << endl;
- cout << "Iron: " << ironInvPol;
- cout << endl;
- cout << "Flour: " << flourInvPol;
- cout << endl;
- cout << "Dyes: " << dyeInvPol;
- cout << endl;
- cout << "Leatherworks: " << leatherInvPol;
- cout << endl;
- cout << "Fur: " << furInvPol;
- cout << endl;
- cout << "Beer: " << beerInvPol;
- cout << endl;
- cout << "Salt: " << saltInvPol;
- cout << endl;
- cout << "Wine: " << wineInvPol;
- cout << endl;
- }
- else if (country == "Russia"){
- cout << endl;
- cout << "Russia's Exports and Imports . . . ";
- cout << endl;
- cout << "Exports: Furs, Dyes, Spice, Wool";
- cout << endl;
- cout << "Imports: Oil, Fish, Salt, Velvet, Flour, Pottery, Beer, Tools, Iron, Leatherworks";
- cout << endl;
- // Checking . . .
- cout << "Russia's Inventory . . . ";
- cout << endl;
- cout << "Pottery: " << potInvRus;
- cout << endl;
- cout << "Oil: " << oilInvRus;
- cout << endl;
- cout << "Fish: " << fishInvRus;
- cout << endl;
- cout << "Wool Cloth:" << woolInvRus;
- cout << endl;
- cout << "Velvet: " << velvetInvRus;
- cout << endl;
- cout << "Tools: " << toolsInvRus;
- cout << endl;
- cout << "Spice: " << spiceInvRus;
- cout << endl;
- cout << "Iron: " << ironInvRus;
- cout << endl;
- cout << "Flour: " << flourInvRus;
- cout << endl;
- cout << "Dyes: " << dyeInvRus;
- cout << endl;
- cout << "Leatherworks: " << leatherInvRus;
- cout << endl;
- cout << "Fur: " << furInvRus;
- cout << endl;
- cout << "Beer: " << beerInvRus;
- cout << endl;
- cout << "Salt: " << saltInvRus;
- cout << endl;
- cout << "Wine: " << wineInvRus;
- cout << endl;
- }
- else if (country == "Crimea"){
- cout << endl;
- cout << "Crimea's Exports and Imports . . . ";
- cout << endl;
- cout << "Exports: Leatherworks, Salt, Wine";
- cout << endl;
- cout << "Imports: Iron, Oil, Beer";
- cout << endl;
- // Checking . . .
- cout << "Crimea's Inventory . . . ";
- cout << endl;
- cout << "Pottery: " << potInvCri;
- cout << endl;
- cout << "Oil: " << oilInvCri;
- cout << endl;
- cout << "Fish: " << fishInvCri;
- cout << endl;
- cout << "Wool Cloth:" << woolInvCri;
- cout << endl;
- cout << "Velvet: " << velvetInvCri;
- cout << endl;
- cout << "Tools: " << toolsInvCri;
- cout << endl;
- cout << "Spice: " << spiceInvCri;
- cout << endl;
- cout << "Iron: " << ironInvCri;
- cout << endl;
- cout << "Flour: " << flourInvCri;
- cout << endl;
- cout << "Dyes: " << dyeInvCri;
- cout << endl;
- cout << "Leatherworks: " << leatherInvCri;
- cout << endl;
- cout << "Fur: " << furInvCri;
- cout << endl;
- cout << "Beer: " << beerInvCri;
- cout << endl;
- cout << "Salt: " << saltInvCri;
- cout << endl;
- cout << "Wine: " << wineInvCri;
- cout << endl;
- }
- else if (country == "Saudi"){
- cout << endl;
- cout << "Saudi Arabia's Exports and Imports . . . ";
- cout << endl;
- cout << "Exports: Salt, Pottery, Velvet";
- cout << endl;
- cout << "Imports: Flour, Beer, Fish";
- cout << endl;
- // Checking . . .
- cout << "Pottery: " << potInvSau;
- cout << endl;
- cout << "Oil: " << oilInvSau;
- cout << endl;
- cout << "Fish: " << fishInvSau;
- cout << endl;
- cout << "Wool Cloth:" << woolInvSau;
- cout << endl;
- cout << "Velvet: " << velvetInvSau;
- cout << endl;
- cout << "Tools: " << toolsInvSau;
- cout << endl;
- cout << "Spice: " << spiceInvSau;
- cout << endl;
- cout << "Iron: " << ironInvSau;
- cout << endl;
- cout << "Flour: " << flourInvSau;
- cout << endl;
- cout << "Dyes: " << dyeInvSau;
- cout << endl;
- cout << "Leatherworks: " << leatherInvSau;
- cout << endl;
- cout << "Fur: " << furInvSau;
- cout << endl;
- cout << "Beer: " << beerInvSau;
- cout << endl;
- cout << "Salt: " << saltInvSau;
- cout << endl;
- cout << "Wine: " << wineInvSau;
- cout << endl;
- }
- else if (country == "Ukraine"){
- cout << endl;
- cout << "Ukraine's exports and imports are slightly well-met . . . ";
- cout << endl;
- //For checking . . .
- cout << "Ukraine's Inventory . . . ";
- cout << endl;
- cout << "Pottery: " << potInvUkr;
- cout << endl;
- cout << "Oil: " << oilInvUkr;
- cout << endl;
- cout << "Fish: " << fishInvUkr;
- cout << endl;
- cout << "Wool Cloth:" << woolInvUkr;
- cout << endl;
- cout << "Velvet: " << velvetInvUkr;
- cout << endl;
- cout << "Tools: " << toolsInvUkr;
- cout << endl;
- cout << "Spice: " << spiceInvUkr;
- cout << endl;
- cout << "Iron: " << ironInvUkr;
- cout << endl;
- cout << "Flour: " << flourInvUkr;
- cout << endl;
- cout << "Dyes: " << dyeInvUkr;
- cout << endl;
- cout << "Leatherworks: " << leatherInvUkr;
- cout << endl;
- cout << "Fur: " << furInvUkr;
- cout << endl;
- cout << "Beer: " << beerInvUkr;
- cout << endl;
- cout << "Salt: " << saltInvUkr;
- cout << endl;
- cout << "Wine: " << wineInvUkr;
- cout << endl;
- }
- else if (country == "China"){
- cout << endl;
- cout << "China's exports and imports are well-met . . . ";
- cout << endl;
- //For checking . . .
- cout << "China's Inventory . . . ";
- cout << endl;
- cout << "Pottery: " << potInvChi;
- cout << endl;
- cout << "Oil: " << oilInvChi;
- cout << endl;
- cout << "Fish: " << fishInvChi;
- cout << endl;
- cout << "Wool Cloth:" << woolInvChi;
- cout << endl;
- cout << "Velvet: " << velvetInvChi;
- cout << endl;
- cout << "Tools: " << toolsInvChi;
- cout << endl;
- cout << "Spice: " << spiceInvChi;
- cout << endl;
- cout << "Iron: " << ironInvChi;
- cout << endl;
- cout << "Flour: " << flourInvChi;
- cout << endl;
- cout << "Dyes: " << dyeInvChi;
- cout << endl;
- cout << "Leatherworks: " << leatherInvChi;
- cout << endl;
- cout << "Fur: " << furInvChi;
- cout << endl;
- cout << "Beer: " << beerInvChi;
- cout << endl;
- cout << "Salt: " << saltInvChi;
- cout << endl;
- cout << "Wine: " << wineInvChi;
- cout << endl;
- }
- else if (country == "None"){
- cout << "Input country notes: ";
- cin >> country;
- notes();
- }
- else{
- cout << "Input country notes: ";
- cin >> country;
- notes();
- }
- system("pause");
- if (mem2 == 1) trade();
- else if (mem2 == 2) buy();
- else if (mem2 == 3) sell();
- else if (mem2 == 4) quantity();
- else if (mem2 == 5) todo2();
- }
- //balance function
- void balance_balance(void){
- cout << endl;
- cout << setprecision(2) << fixed;
- cout << "Balance: Eur " << balance;
- cout << endl;
- }
- //todo function
- void todo(void){
- if (land == 0){
- cout << endl;
- cout << "You are now trading with Sweden . . . ";
- cout << endl;
- todo2();
- }
- else if (land == 1){
- cout << endl;
- cout << "You are now trading with Poland . . . ";
- cout << endl;
- todo2();
- }
- else if (land == 2){
- cout << endl;
- cout << "You are now trading with Russia . . . ";
- cout << endl;
- todo2();
- }
- else if (land == 3){
- cout << endl;
- cout << "You are now trading with Crimea . . . ";
- cout << endl;
- todo2();
- }
- else if (land == 4){
- cout << endl;
- cout << "You are now trading with Saudi Arabia . . . ";
- cout << endl;
- todo2();
- }
- else if (land == 5){
- cout << endl;
- cout << "You are now trading with Ukraine . . . ";
- cout << endl;
- todo2();
- }
- else if (land == 6){
- cout << endl;
- cout << "You are now trading with China . . . ";
- cout << endl;
- todo2();
- }
- }
- //todo2 function
- void todo2(void){
- int x;
- country = "None";
- mem = 4;
- mem2 = 5;
- cout << endl;
- cout << "[1] Buy";
- cout << endl;
- cout << "[2] Sell";
- cout << endl;
- cout << "[3] Check inventory";
- cout << endl;
- cout << "[4] Check notes";
- cout << endl;
- cout << "[5] Return";
- cout << endl;
- string input;
- cout << "Options: ";
- cin >> input;
- stringstream(input) >> x;
- switch (x){
- case 1:
- buy();
- break;
- case 2:
- sell();
- break;
- case 3:
- check();
- break;
- case 4:
- notes();
- break;
- case 5:
- trade();
- break;
- default:
- todo();
- }
- }
- //country inventory
- void countryInv(void){
- if (land==0){
- //Buy
- //Buying pot
- if (goodType==0 && mem3==0){
- if (qty>potInvSwede){
- cout << "Sweden does not have " << qty << " Pottery.";
- quantity();
- }
- else potInvSwede -= qty;
- }
- //Buying oil
- else if (goodType==1 && mem3==0){
- if (qty>oilInvSwede){
- cout << "Sweden does not have " << qty << " Oil.";
- quantity();
- }
- else oilInvSwede -= qty;
- }
- //Buying fish
- if (goodType==2 && mem3==0){
- if (qty>fishInvSwede){
- cout << "Sweden does not have " << qty << " Fish.";
- quantity();
- }
- else fishInvSwede -= qty;
- }
- //Buying wool
- if (goodType==3 && mem3==0){
- if (qty>woolInvSwede){
- cout << "Sweden does not have " << qty << " Wool Cloth.";
- quantity();
- }
- else woolInvSwede -= qty;
- }
- //Buying velvet
- if (goodType==4 && mem3==0){
- if (qty>velvetInvSwede){
- cout << "Sweden does not have " << qty << " Velvet.";
- quantity();
- }
- else velvetInvSwede -= qty;
- }
- //Buying tools
- if (goodType==5 && mem3==0){
- if (qty>toolsInvSwede){
- cout << "Sweden does not have " << qty << " Tools.";
- quantity();
- }
- else toolsInvSwede -= qty;
- }
- //Buying spice
- if (goodType==6 && mem3==0){
- if (qty>spiceInvSwede){
- cout << "Sweden does not have " << qty << " Spice.";
- quantity();
- }
- else spiceInvSwede -= qty;
- }
- //Buying iron
- if (goodType==7 && mem3==0){
- if (qty>ironInvSwede){
- cout << "Sweden does not have " << qty << " Iron.";
- quantity();
- }
- else ironInvSwede -= qty;
- }
- //Buying flour
- if (goodType==8 && mem3==0){
- if (qty>flourInvSwede){
- cout << "Sweden does not have " << qty << " Flour.";
- quantity();
- }
- else flourInvSwede -= qty;
- }
- //Buying dye
- if (goodType==9 && mem3==0){
- if (qty>dyeInvSwede){
- cout << "Sweden does not have " << qty << " Dyes.";
- quantity();
- }
- else dyeInvSwede -= qty;
- }
- //Buying leather
- if (goodType==10 && mem3==0){
- if (qty>leatherInvSwede){
- cout << "Sweden does not have " << qty << " Leatherworks.";
- quantity();
- }
- else leatherInvSwede -= qty;
- }
- //Buying fur
- if (goodType==11 && mem3==0){
- if (qty>furInvSwede){
- cout << "Sweden does not have " << qty << " Fur.";
- quantity();
- }
- else furInvSwede -= qty;
- }
- //Buying beer
- if (goodType==12 && mem3==0){
- if (qty>beerInvSwede){
- cout << "Sweden does not have " << qty << " Beer.";
- quantity();
- }
- else beerInvSwede -= qty;
- }
- //Buying salt
- if (goodType==13 && mem3==0){
- if (qty>saltInvSwede){
- cout << "Sweden does not have " << qty << " Salt.";
- quantity();
- }
- else saltInvSwede -= qty;
- }
- //Buying wine
- if (goodType==14 && mem3==0){
- if (qty>wineInvSwede){
- cout << "Sweden does not have " << qty << " Wine.";
- quantity();
- }
- else wineInvSwede -= qty;
- }
- //Sell
- //Selling pot
- if (goodType==0 && mem3==1){
- potInvSwede += qty;
- }
- //Selling oil
- else if (goodType==1 && mem3==1){
- oilInvSwede += qty;
- }
- if (goodType==2 && mem3==1){
- fishInvSwede += qty;
- }
- if (goodType==3 && mem3==1){
- woolInvSwede += qty;
- }
- if (goodType==4 && mem3==1){
- velvetInvSwede += qty;
- }
- if (goodType==5 && mem3==1){
- toolsInvSwede += qty;
- }
- if (goodType==6 && mem3==1){
- spiceInvSwede += qty;
- }
- if (goodType==7 && mem3==1){
- ironInvSwede += qty;
- }
- if (goodType==8 && mem3==1){
- flourInvSwede += qty;
- }
- if (goodType==9 && mem3==1){
- dyeInvSwede += qty;
- }
- if (goodType==10 && mem3==1){
- leatherInvSwede += qty;
- }
- if (goodType==11 && mem3==1){
- furInvSwede += qty;
- }
- if (goodType==12 && mem3==1){
- beerInvSwede += qty;
- }
- if (goodType==13 && mem3==1){
- saltInvSwede += qty;
- }
- if (goodType==14 && mem3==1){
- wineInvSwede += qty;
- }
- }
- else if (land==1){
- //Buy
- //Buying pot
- if (goodType==0 && mem3==0){
- if (qty>potInvPol){
- cout << "Poland does not have " << qty << " Pottery.";
- quantity();
- }
- else potInvPol -= qty;
- }
- //Buying oil
- else if (goodType==1 && mem3==0){
- if (qty>oilInvPol){
- cout << "Poland does not have " << qty << " Oil.";
- quantity();
- }
- else oilInvPol -= qty;
- }
- //Buying fish
- if (goodType==2 && mem3==0){
- if (qty>fishInvPol){
- cout << "Poland does not have " << qty << " Fish.";
- quantity();
- }
- else fishInvPol -= qty;
- }
- //Buying wool
- if (goodType==3 && mem3==0){
- if (qty>woolInvPol){
- cout << "Poland does not have " << qty << " Wool Cloth.";
- quantity();
- }
- else woolInvPol -= qty;
- }
- //Buying velvet
- if (goodType==4 && mem3==0){
- if (qty>velvetInvPol){
- cout << "Poland does not have " << qty << " Velvet.";
- quantity();
- }
- else velvetInvPol -= qty;
- }
- //Buying tools
- if (goodType==5 && mem3==0){
- if (qty>toolsInvPol){
- cout << "Poland does not have " << qty << " Tools.";
- quantity();
- }
- else toolsInvPol -= qty;
- }
- //Buying spice
- if (goodType==6 && mem3==0){
- if (qty>spiceInvPol){
- cout << "Poland does not have " << qty << " Spice.";
- quantity();
- }
- else spiceInvPol -= qty;
- }
- //Buying iron
- if (goodType==7 && mem3==0){
- if (qty>ironInvPol){
- cout << "Poland does not have " << qty << " Iron.";
- quantity();
- }
- else ironInvPol -= qty;
- }
- //Buying flour
- if (goodType==8 && mem3==0){
- if (qty>flourInvPol){
- cout << "Poland does not have " << qty << " Flour.";
- quantity();
- }
- else flourInvPol -= qty;
- }
- //Buying dye
- if (goodType==9 && mem3==0){
- if (qty>dyeInvPol){
- cout << "Poland does not have " << qty << " Dyes.";
- quantity();
- }
- else dyeInvPol -= qty;
- }
- //Buying leather
- if (goodType==10 && mem3==0){
- if (qty>leatherInvPol){
- cout << "Poland does not have " << qty << " Leatherworks.";
- quantity();
- }
- else leatherInvPol -= qty;
- }
- //Buying fur
- if (goodType==11 && mem3==0){
- if (qty>furInvPol){
- cout << "Poland does not have " << qty << " Fur.";
- quantity();
- }
- else furInvPol -= qty;
- }
- //Buying beer
- if (goodType==12 && mem3==0){
- if (qty>beerInvPol){
- cout << "Poland does not have " << qty << " Beer.";
- quantity();
- }
- else beerInvPol -= qty;
- }
- //Buying salt
- if (goodType==13 && mem3==0){
- if (qty>saltInvPol){
- cout << "Poland does not have " << qty << " Salt.";
- quantity();
- }
- else saltInvPol -= qty;
- }
- //Buying wine
- if (goodType==14 && mem3==0){
- if (qty>wineInvPol){
- cout << "Poland does not have " << qty << " Wine.";
- quantity();
- }
- else wineInvPol -= qty;
- }
- //Sell
- //Selling pot
- if (goodType==0 && mem3==1){
- potInvPol += qty;
- }
- //Selling oil
- else if (goodType==1 && mem3==1){
- oilInvPol += qty;
- }
- if (goodType==2 && mem3==1){
- fishInvPol += qty;
- }
- if (goodType==3 && mem3==1){
- woolInvPol += qty;
- }
- if (goodType==4 && mem3==1){
- velvetInvPol += qty;
- }
- if (goodType==5 && mem3==1){
- toolsInvPol += qty;
- }
- if (goodType==6 && mem3==1){
- spiceInvPol += qty;
- }
- if (goodType==7 && mem3==1){
- ironInvPol += qty;
- }
- if (goodType==8 && mem3==1){
- flourInvPol += qty;
- }
- if (goodType==9 && mem3==1){
- dyeInvPol += qty;
- }
- if (goodType==10 && mem3==1){
- leatherInvPol += qty;
- }
- if (goodType==11 && mem3==1){
- furInvPol += qty;
- }
- if (goodType==12 && mem3==1){
- beerInvPol += qty;
- }
- if (goodType==13 && mem3==1){
- saltInvPol += qty;
- }
- if (goodType==14 && mem3==1){
- wineInvPol += qty;
- }
- }
- else if (land==2){
- //Buy
- //Buying pot
- if (goodType==0 && mem3==0){
- if (qty>potInvRus){
- cout << "Russia does not have " << qty << " Pottery.";
- quantity();
- }
- else potInvRus -= qty;
- }
- //Buying oil
- else if (goodType==1 && mem3==0){
- if (qty>oilInvRus){
- cout << "Russia does not have " << qty << " Oil.";
- quantity();
- }
- else oilInvRus -= qty;
- }
- //Buying fish
- if (goodType==2 && mem3==0){
- if (qty>fishInvRus){
- cout << "Russia does not have " << qty << " Fish.";
- quantity();
- }
- else fishInvRus -= qty;
- }
- //Buying wool
- if (goodType==3 && mem3==0){
- if (qty>woolInvRus){
- cout << "Russia does not have " << qty << " Wool Cloth.";
- quantity();
- }
- else woolInvRus -= qty;
- }
- //Buying velvet
- if (goodType==4 && mem3==0){
- if (qty>velvetInvRus){
- cout << "Russia does not have " << qty << " Velvet.";
- quantity();
- }
- else velvetInvRus -= qty;
- }
- //Buying tools
- if (goodType==5 && mem3==0){
- if (qty>toolsInvRus){
- cout << "Russia does not have " << qty << " Tools.";
- quantity();
- }
- else toolsInvRus -= qty;
- }
- //Buying spice
- if (goodType==6 && mem3==0){
- if (qty>spiceInvRus){
- cout << "Russia does not have " << qty << " Spice.";
- quantity();
- }
- else spiceInvRus -= qty;
- }
- //Buying iron
- if (goodType==7 && mem3==0){
- if (qty>ironInvRus){
- cout << "Russia does not have " << qty << " Iron.";
- quantity();
- }
- else ironInvRus -= qty;
- }
- //Buying flour
- if (goodType==8 && mem3==0){
- if (qty>flourInvRus){
- cout << "Russia does not have " << qty << " Flour.";
- quantity();
- }
- else flourInvRus -= qty;
- }
- //Buying dye
- if (goodType==9 && mem3==0){
- if (qty>dyeInvRus){
- cout << "Russia does not have " << qty << " Dyes.";
- quantity();
- }
- else dyeInvRus -= qty;
- }
- //Buying leather
- if (goodType==10 && mem3==0){
- if (qty>leatherInvRus){
- cout << "Russia does not have " << qty << " Leatherworks.";
- quantity();
- }
- else leatherInvRus -= qty;
- }
- //Buying fur
- if (goodType==11 && mem3==0){
- if (qty>furInvRus){
- cout << "Russia does not have " << qty << " Fur.";
- quantity();
- }
- else furInvRus -= qty;
- }
- //Buying beer
- if (goodType==12 && mem3==0){
- if (qty>beerInvRus){
- cout << "Russia does not have " << qty << " Beer.";
- quantity();
- }
- else beerInvRus -= qty;
- }
- //Buying salt
- if (goodType==13 && mem3==0){
- if (qty>saltInvRus){
- cout << "Russia does not have " << qty << " Salt.";
- quantity();
- }
- else saltInvRus -= qty;
- }
- //Buying wine
- if (goodType==14 && mem3==0){
- if (qty>wineInvRus){
- cout << "Russia does not have " << qty << " Wine.";
- quantity();
- }
- else wineInvRus -= qty;
- }
- //Sell
- //Selling pot
- if (goodType==0 && mem3==1){
- potInvRus += qty;
- }
- //Selling oil
- else if (goodType==1 && mem3==1){
- oilInvRus += qty;
- }
- if (goodType==2 && mem3==1){
- fishInvRus += qty;
- }
- if (goodType==3 && mem3==1){
- woolInvRus += qty;
- }
- if (goodType==4 && mem3==1){
- velvetInvRus += qty;
- }
- if (goodType==5 && mem3==1){
- toolsInvRus += qty;
- }
- if (goodType==6 && mem3==1){
- spiceInvRus += qty;
- }
- if (goodType==7 && mem3==1){
- ironInvRus += qty;
- }
- if (goodType==8 && mem3==1){
- flourInvRus += qty;
- }
- if (goodType==9 && mem3==1){
- dyeInvRus += qty;
- }
- if (goodType==10 && mem3==1){
- leatherInvRus += qty;
- }
- if (goodType==11 && mem3==1){
- furInvRus += qty;
- }
- if (goodType==12 && mem3==1){
- beerInvRus += qty;
- }
- if (goodType==13 && mem3==1){
- saltInvRus += qty;
- }
- if (goodType==14 && mem3==1){
- wineInvRus += qty;
- }
- }
- else if (land==3){
- //Buy
- //Buying pot
- if (goodType==0 && mem3==0){
- if (qty>potInvCri){
- cout << "Crimea does not have " << qty << " Pottery.";
- quantity();
- }
- else potInvCri -= qty;
- }
- //Buying oil
- else if (goodType==1 && mem3==0){
- if (qty>oilInvCri){
- cout << "Crimea does not have " << qty << " Oil.";
- quantity();
- }
- else oilInvCri -= qty;
- }
- //Buying fish
- if (goodType==2 && mem3==0){
- if (qty>fishInvCri){
- cout << "Crimea does not have " << qty << " Fish.";
- quantity();
- }
- else fishInvCri -= qty;
- }
- //Buying wool
- if (goodType==3 && mem3==0){
- if (qty>woolInvCri){
- cout << "Crimea does not have " << qty << " Wool Cloth.";
- quantity();
- }
- else woolInvCri -= qty;
- }
- //Buying velvet
- if (goodType==4 && mem3==0){
- if (qty>velvetInvCri){
- cout << "Crimea does not have " << qty << " Velvet.";
- quantity();
- }
- else velvetInvCri -= qty;
- }
- //Buying tools
- if (goodType==5 && mem3==0){
- if (qty>toolsInvCri){
- cout << "Crimea does not have " << qty << " Tools.";
- quantity();
- }
- else toolsInvCri -= qty;
- }
- //Buying spice
- if (goodType==6 && mem3==0){
- if (qty>spiceInvCri){
- cout << "Crimea does not have " << qty << " Spice.";
- quantity();
- }
- else spiceInvCri -= qty;
- }
- //Buying iron
- if (goodType==7 && mem3==0){
- if (qty>ironInvCri){
- cout << "Crimea does not have " << qty << " Iron.";
- quantity();
- }
- else ironInvCri -= qty;
- }
- //Buying flour
- if (goodType==8 && mem3==0){
- if (qty>flourInvCri){
- cout << "Crimea does not have " << qty << " Flour.";
- quantity();
- }
- else flourInvCri -= qty;
- }
- //Buying dye
- if (goodType==9 && mem3==0){
- if (qty>dyeInvCri){
- cout << "Crimea does not have " << qty << " Dyes.";
- quantity();
- }
- else dyeInvCri -= qty;
- }
- //Buying leather
- if (goodType==10 && mem3==0){
- if (qty>leatherInvCri){
- cout << "Crimea does not have " << qty << " Leatherworks.";
- quantity();
- }
- else leatherInvCri -= qty;
- }
- //Buying fur
- if (goodType==11 && mem3==0){
- if (qty>furInvCri){
- cout << "Crimea does not have " << qty << " Fur.";
- quantity();
- }
- else furInvCri -= qty;
- }
- //Buying beer
- if (goodType==12 && mem3==0){
- if (qty>beerInvCri){
- cout << "Crimea does not have " << qty << " Beer.";
- quantity();
- }
- else beerInvCri -= qty;
- }
- //Buying salt
- if (goodType==13 && mem3==0){
- if (qty>saltInvCri){
- cout << "Crimea does not have " << qty << " Salt.";
- quantity();
- }
- else saltInvCri -= qty;
- }
- //Buying wine
- if (goodType==14 && mem3==0){
- if (qty>wineInvCri){
- cout << "Crimea does not have " << qty << " Wine.";
- quantity();
- }
- else wineInvCri -= qty;
- }
- //Sell
- //Selling pot
- if (goodType==0 && mem3==1){
- potInvCri += qty;
- }
- //Selling oil
- else if (goodType==1 && mem3==1){
- oilInvCri += qty;
- }
- if (goodType==2 && mem3==1){
- fishInvCri += qty;
- }
- if (goodType==3 && mem3==1){
- woolInvCri += qty;
- }
- if (goodType==4 && mem3==1){
- velvetInvCri += qty;
- }
- if (goodType==5 && mem3==1){
- toolsInvCri += qty;
- }
- if (goodType==6 && mem3==1){
- spiceInvCri += qty;
- }
- if (goodType==7 && mem3==1){
- ironInvCri += qty;
- }
- if (goodType==8 && mem3==1){
- flourInvCri += qty;
- }
- if (goodType==9 && mem3==1){
- dyeInvCri += qty;
- }
- if (goodType==10 && mem3==1){
- leatherInvCri += qty;
- }
- if (goodType==11 && mem3==1){
- furInvCri += qty;
- }
- if (goodType==12 && mem3==1){
- beerInvCri += qty;
- }
- if (goodType==13 && mem3==1){
- saltInvCri += qty;
- }
- if (goodType==14 && mem3==1){
- wineInvCri += qty;
- }
- }
- else if (land==4){
- //Buy
- //Buying pot
- if (goodType==0 && mem3==0){
- if (qty>potInvSau){
- cout << "Saudi does not have " << qty << " Pottery.";
- quantity();
- }
- else potInvSau -= qty;
- }
- //Buying oil
- else if (goodType==1 && mem3==0){
- if (qty>oilInvSau){
- cout << "Saudi does not have " << qty << " Oil.";
- quantity();
- }
- else oilInvSau -= qty;
- }
- //Buying fish
- if (goodType==2 && mem3==0){
- if (qty>fishInvSau){
- cout << "Saudi does not have " << qty << " Fish.";
- quantity();
- }
- else fishInvSau -= qty;
- }
- //Buying wool
- if (goodType==3 && mem3==0){
- if (qty>woolInvSau){
- cout << "Saudi does not have " << qty << " Wool Cloth.";
- quantity();
- }
- else woolInvSau -= qty;
- }
- //Buying velvet
- if (goodType==4 && mem3==0){
- if (qty>velvetInvSau){
- cout << "Saudi does not have " << qty << " Velvet.";
- quantity();
- }
- else velvetInvSau -= qty;
- }
- //Buying tools
- if (goodType==5 && mem3==0){
- if (qty>toolsInvSau){
- cout << "Saudi does not have " << qty << " Tools.";
- quantity();
- }
- else toolsInvSau -= qty;
- }
- //Buying spice
- if (goodType==6 && mem3==0){
- if (qty>spiceInvSau){
- cout << "Saudi does not have " << qty << " Spice.";
- quantity();
- }
- else spiceInvSau -= qty;
- }
- //Buying iron
- if (goodType==7 && mem3==0){
- if (qty>ironInvSau){
- cout << "Saudi does not have " << qty << " Iron.";
- quantity();
- }
- else ironInvSau -= qty;
- }
- //Buying flour
- if (goodType==8 && mem3==0){
- if (qty>flourInvSau){
- cout << "Saudi does not have " << qty << " Flour.";
- quantity();
- }
- else flourInvSau -= qty;
- }
- //Buying dye
- if (goodType==9 && mem3==0){
- if (qty>dyeInvSau){
- cout << "Saudi does not have " << qty << " Dyes.";
- quantity();
- }
- else dyeInvSau -= qty;
- }
- //Buying leather
- if (goodType==10 && mem3==0){
- if (qty>leatherInvSau){
- cout << "Saudi does not have " << qty << " Leatherworks.";
- quantity();
- }
- else leatherInvSau -= qty;
- }
- //Buying fur
- if (goodType==11 && mem3==0){
- if (qty>furInvSau){
- cout << "Saudi does not have " << qty << " Fur.";
- quantity();
- }
- else furInvSau -= qty;
- }
- //Buying beer
- if (goodType==12 && mem3==0){
- if (qty>beerInvSau){
- cout << "Saudi does not have " << qty << " Beer.";
- quantity();
- }
- else beerInvSau -= qty;
- }
- //Buying salt
- if (goodType==13 && mem3==0){
- if (qty>saltInvSau){
- cout << "Saudi does not have " << qty << " Salt.";
- quantity();
- }
- else saltInvSau -= qty;
- }
- //Buying wine
- if (goodType==14 && mem3==0){
- if (qty>wineInvSau){
- cout << "Saudi does not have " << qty << " Wine.";
- quantity();
- }
- else wineInvSau -= qty;
- }
- //Sell
- //Selling pot
- if (goodType==0 && mem3==1){
- potInvSau += qty;
- }
- //Selling oil
- else if (goodType==1 && mem3==1){
- oilInvSau += qty;
- }
- if (goodType==2 && mem3==1){
- fishInvSau += qty;
- }
- if (goodType==3 && mem3==1){
- woolInvSau += qty;
- }
- if (goodType==4 && mem3==1){
- velvetInvSau += qty;
- }
- if (goodType==5 && mem3==1){
- toolsInvSau += qty;
- }
- if (goodType==6 && mem3==1){
- spiceInvSau += qty;
- }
- if (goodType==7 && mem3==1){
- ironInvSau += qty;
- }
- if (goodType==8 && mem3==1){
- flourInvSau += qty;
- }
- if (goodType==9 && mem3==1){
- dyeInvSau += qty;
- }
- if (goodType==10 && mem3==1){
- leatherInvSau += qty;
- }
- if (goodType==11 && mem3==1){
- furInvSau += qty;
- }
- if (goodType==12 && mem3==1){
- beerInvSau += qty;
- }
- if (goodType==13 && mem3==1){
- saltInvSau += qty;
- }
- if (goodType==14 && mem3==1){
- wineInvSau += qty;
- }
- }
- else if (land==5){
- //Buy
- //Buying pot
- if (goodType==0 && mem3==0){
- if (qty>potInvUkr){
- cout << "Ukraine does not have " << qty << " Pottery.";
- quantity();
- }
- else potInvUkr -= qty;
- }
- //Buying oil
- else if (goodType==1 && mem3==0){
- if (qty>oilInvUkr){
- cout << "Ukraine does not have " << qty << " Oil.";
- quantity();
- }
- else oilInvUkr -= qty;
- }
- //Buying fish
- if (goodType==2 && mem3==0){
- if (qty>fishInvUkr){
- cout << "Ukraine does not have " << qty << " Fish.";
- quantity();
- }
- else fishInvUkr -= qty;
- }
- //Buying wool
- if (goodType==3 && mem3==0){
- if (qty>woolInvUkr){
- cout << "Ukraine does not have " << qty << " Wool Cloth.";
- quantity();
- }
- else woolInvUkr -= qty;
- }
- //Buying velvet
- if (goodType==4 && mem3==0){
- if (qty>velvetInvUkr){
- cout << "Ukraine does not have " << qty << " Velvet.";
- quantity();
- }
- else velvetInvUkr -= qty;
- }
- //Buying tools
- if (goodType==5 && mem3==0){
- if (qty>toolsInvUkr){
- cout << "Ukraine does not have " << qty << " Tools.";
- quantity();
- }
- else toolsInvUkr -= qty;
- }
- //Buying spice
- if (goodType==6 && mem3==0){
- if (qty>spiceInvUkr){
- cout << "Ukraine does not have " << qty << " Spice.";
- quantity();
- }
- else spiceInvUkr -= qty;
- }
- //Buying iron
- if (goodType==7 && mem3==0){
- if (qty>ironInvUkr){
- cout << "Ukraine does not have " << qty << " Iron.";
- quantity();
- }
- else ironInvUkr -= qty;
- }
- //Buying flour
- if (goodType==8 && mem3==0){
- if (qty>flourInvUkr){
- cout << "Ukraine does not have " << qty << " Flour.";
- quantity();
- }
- else flourInvUkr -= qty;
- }
- //Buying dye
- if (goodType==9 && mem3==0){
- if (qty>dyeInvUkr){
- cout << "Ukraine does not have " << qty << " Dyes.";
- quantity();
- }
- else dyeInvUkr -= qty;
- }
- //Buying leather
- if (goodType==10 && mem3==0){
- if (qty>leatherInvUkr){
- cout << "Ukraine does not have " << qty << " Leatherworks.";
- quantity();
- }
- else leatherInvUkr -= qty;
- }
- //Buying fur
- if (goodType==11 && mem3==0){
- if (qty>furInvUkr){
- cout << "Ukraine does not have " << qty << " Fur.";
- quantity();
- }
- else furInvUkr -= qty;
- }
- //Buying beer
- if (goodType==12 && mem3==0){
- if (qty>beerInvUkr){
- cout << "Ukraine does not have " << qty << " Beer.";
- quantity();
- }
- else beerInvUkr -= qty;
- }
- //Buying salt
- if (goodType==13 && mem3==0){
- if (qty>saltInvUkr){
- cout << "Ukraine does not have " << qty << " Salt.";
- quantity();
- }
- else saltInvUkr -= qty;
- }
- //Buying wine
- if (goodType==14 && mem3==0){
- if (qty>wineInvUkr){
- cout << "Ukraine does not have " << qty << " Wine.";
- quantity();
- }
- else wineInvUkr -= qty;
- }
- //Sell
- //Selling pot
- if (goodType==0 && mem3==1){
- potInvUkr += qty;
- }
- //Selling oil
- else if (goodType==1 && mem3==1){
- oilInvUkr += qty;
- }
- if (goodType==2 && mem3==1){
- fishInvUkr += qty;
- }
- if (goodType==3 && mem3==1){
- woolInvUkr += qty;
- }
- if (goodType==4 && mem3==1){
- velvetInvUkr += qty;
- }
- if (goodType==5 && mem3==1){
- toolsInvUkr += qty;
- }
- if (goodType==6 && mem3==1){
- spiceInvUkr += qty;
- }
- if (goodType==7 && mem3==1){
- ironInvUkr += qty;
- }
- if (goodType==8 && mem3==1){
- flourInvUkr += qty;
- }
- if (goodType==9 && mem3==1){
- dyeInvUkr += qty;
- }
- if (goodType==10 && mem3==1){
- leatherInvUkr += qty;
- }
- if (goodType==11 && mem3==1){
- furInvUkr += qty;
- }
- if (goodType==12 && mem3==1){
- beerInvUkr += qty;
- }
- if (goodType==13 && mem3==1){
- saltInvUkr += qty;
- }
- if (goodType==14 && mem3==1){
- wineInvUkr += qty;
- }
- }
- else if (land==6){
- //Buy
- //Buying pot
- if (goodType==0 && mem3==0){
- if (qty>potInvChi){
- cout << "China does not have " << qty << " Pottery.";
- quantity();
- }
- else potInvChi -= qty;
- }
- //Buying oil
- else if (goodType==1 && mem3==0){
- if (qty>oilInvChi){
- cout << "China does not have " << qty << " Oil.";
- quantity();
- }
- else oilInvChi -= qty;
- }
- //Buying fish
- if (goodType==2 && mem3==0){
- if (qty>fishInvChi){
- cout << "China does not have " << qty << " Fish.";
- quantity();
- }
- else fishInvChi -= qty;
- }
- //Buying wool
- if (goodType==3 && mem3==0){
- if (qty>woolInvChi){
- cout << "China does not have " << qty << " Wool Cloth.";
- quantity();
- }
- else woolInvChi -= qty;
- }
- //Buying velvet
- if (goodType==4 && mem3==0){
- if (qty>velvetInvChi){
- cout << "China does not have " << qty << " Velvet.";
- quantity();
- }
- else velvetInvChi -= qty;
- }
- //Buying tools
- if (goodType==5 && mem3==0){
- if (qty>toolsInvChi){
- cout << "China does not have " << qty << " Tools.";
- quantity();
- }
- else toolsInvChi -= qty;
- }
- //Buying spice
- if (goodType==6 && mem3==0){
- if (qty>spiceInvChi){
- cout << "China does not have " << qty << " Spice.";
- quantity();
- }
- else spiceInvChi -= qty;
- }
- //Buying iron
- if (goodType==7 && mem3==0){
- if (qty>ironInvChi){
- cout << "China does not have " << qty << " Iron.";
- quantity();
- }
- else ironInvChi -= qty;
- }
- //Buying flour
- if (goodType==8 && mem3==0){
- if (qty>flourInvChi){
- cout << "China does not have " << qty << " Flour.";
- quantity();
- }
- else flourInvChi -= qty;
- }
- //Buying dye
- if (goodType==9 && mem3==0){
- if (qty>dyeInvChi){
- cout << "China does not have " << qty << " Dyes.";
- quantity();
- }
- else dyeInvChi -= qty;
- }
- //Buying leather
- if (goodType==10 && mem3==0){
- if (qty>leatherInvChi){
- cout << "China does not have " << qty << " Leatherworks.";
- quantity();
- }
- else leatherInvChi -= qty;
- }
- //Buying fur
- if (goodType==11 && mem3==0){
- if (qty>furInvChi){
- cout << "China does not have " << qty << " Fur.";
- quantity();
- }
- else furInvChi -= qty;
- }
- //Buying beer
- if (goodType==12 && mem3==0){
- if (qty>beerInvChi){
- cout << "China does not have " << qty << " Beer.";
- quantity();
- }
- else beerInvChi -= qty;
- }
- //Buying salt
- if (goodType==13 && mem3==0){
- if (qty>saltInvChi){
- cout << "China does not have " << qty << " Salt.";
- quantity();
- }
- else saltInvChi -= qty;
- }
- //Buying wine
- if (goodType==14 && mem3==0){
- if (qty>wineInvChi){
- cout << "China does not have " << qty << " Wine.";
- quantity();
- }
- else wineInvChi -= qty;
- }
- //Sell
- //Selling pot
- if (goodType==0 && mem3==1){
- potInvChi += qty;
- }
- //Selling oil
- else if (goodType==1 && mem3==1){
- oilInvChi += qty;
- }
- if (goodType==2 && mem3==1){
- fishInvChi += qty;
- }
- if (goodType==3 && mem3==1){
- woolInvChi += qty;
- }
- if (goodType==4 && mem3==1){
- velvetInvChi += qty;
- }
- if (goodType==5 && mem3==1){
- toolsInvChi += qty;
- }
- if (goodType==6 && mem3==1){
- spiceInvChi += qty;
- }
- if (goodType==7 && mem3==1){
- ironInvChi += qty;
- }
- if (goodType==8 && mem3==1){
- flourInvChi += qty;
- }
- if (goodType==9 && mem3==1){
- dyeInvChi += qty;
- }
- if (goodType==10 && mem3==1){
- leatherInvChi += qty;
- }
- if (goodType==11 && mem3==1){
- furInvChi += qty;
- }
- if (goodType==12 && mem3==1){
- beerInvChi += qty;
- }
- if (goodType==13 && mem3==1){
- saltInvChi += qty;
- }
- if (goodType==14 && mem3==1){
- wineInvChi += qty;
- }
- }
- }
- //random function
- void random(void){
- goodType = 0;
- for (int i = 1; i <= 15; i++){
- if (goodType == 0){
- if (land == 0){
- inv_Country = potInvSwede;
- }
- else if (land == 1){
- inv_Country = potInvPol;
- }
- else if (land == 2){
- inv_Country = potInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = potInvCri;
- }
- else if (land == 4){
- inv_Country = potInvSau;
- }
- else if (land == 5){
- inv_Country = potInvUkr;
- }
- else if (land == 6){
- inv_Country = potInvChi;
- }
- if (inv_Country >= 76 && inv_Country <= 100){
- price = potPrice[land] + randomnum * 1;
- }
- else if (inv_Country >= 51 && inv_Country <= 75){
- price = potPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 26 && inv_Country <= 50){
- price = potPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 25){
- price = potPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 100){
- price = potPrice[land] * 0.5 + randomnum;
- }
- priceArrays[0] = price;
- }
- else if (goodType == 1){
- if (land == 0){
- inv_Country = oilInvSwede;
- }
- else if (land == 1){
- inv_Country = oilInvPol;
- }
- else if (land == 2){
- inv_Country = oilInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = oilInvCri;
- }
- else if (land == 4){
- inv_Country = oilInvSau;
- }
- else if (land == 5){
- inv_Country = oilInvUkr;
- }
- else if (land == 6){
- inv_Country = oilInvChi;
- }
- if (inv_Country >= 38 && inv_Country <= 50){
- price = oilPrice[land] + randomnum;
- }
- else if (inv_Country >= 26 && inv_Country <= 37){
- price = oilPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 13 && inv_Country <= 25){
- price = oilPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 12){
- price = oilPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 50){
- price = oilPrice[land] * 0.75 + randomnum;
- }
- priceArrays[1] = price;
- }
- else if (goodType == 2){
- if (land == 0){
- inv_Country = fishInvSwede;
- }
- else if (land == 1){
- inv_Country = fishInvPol;
- }
- else if (land == 2){
- inv_Country = fishInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = fishInvCri;
- }
- else if (land == 4){
- inv_Country = fishInvSau;
- }
- else if (land == 5){
- inv_Country = fishInvUkr;
- }
- else if (land == 6){
- inv_Country = fishInvChi;
- }
- if (inv_Country >= 114 && inv_Country <= 150){
- price = fishPrice[land] + randomnum;
- }
- else if (inv_Country >= 76 && inv_Country <= 113){
- price = fishPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 39 && inv_Country <= 75){
- price = fishPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 38){
- price = fishPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 150){
- price = fishPrice[land] * 0.75 + randomnum;
- }
- priceArrays[2] = price;
- }
- else if (goodType == 3){
- if (land == 0){
- inv_Country = woolInvSwede;
- }
- else if (land == 1){
- inv_Country = woolInvPol;
- }
- else if (land == 2){
- inv_Country = woolInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = woolInvCri;
- }
- else if (land == 4){
- inv_Country = woolInvSau;
- }
- else if (land == 5){
- inv_Country = woolInvUkr;
- }
- else if (land == 6){
- inv_Country = woolInvChi;
- }
- if (inv_Country >= 38 && inv_Country <= 75){
- price = woolPrice[land] + randomnum;
- }
- else if (inv_Country >= 26 && inv_Country <= 56){
- price = woolPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 13 && inv_Country <= 38){
- price = woolPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 12){
- price = woolPrice[land] * 2 + randomnum;
- }
- else if (inv_Country < 75){
- price = woolPrice[land] * 0.75 + randomnum;
- }
- priceArrays[3] = price;
- }
- else if (goodType == 4){
- if (land == 0){
- inv_Country = velvetInvSwede;
- }
- else if (land == 1){
- inv_Country = velvetInvPol;
- }
- else if (land == 2){
- inv_Country = velvetInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = velvetInvCri;
- }
- else if (land == 4){
- inv_Country = velvetInvSau;
- }
- else if (land == 5){
- inv_Country = velvetInvUkr;
- }
- else if (land == 6){
- inv_Country = velvetInvChi;
- }
- if (inv_Country >= 20 && inv_Country <= 25){
- price = velvetPrice[land] + randomnum;
- }
- else if (inv_Country >= 14 && inv_Country <= 19){
- price = velvetPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 8 && inv_Country <= 13){
- price = velvetPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 7){
- price = velvetPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 25){
- price = velvetPrice[land] * 0.75 + randomnum;
- }
- priceArrays[4] = price;
- }
- else if (goodType == 5){
- if (land == 0){
- inv_Country = toolsInvSwede;
- }
- else if (land == 1){
- inv_Country = toolsInvPol;
- }
- else if (land == 2){
- inv_Country = toolsInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = toolsInvCri;
- }
- else if (land == 4){
- inv_Country = toolsInvSau;
- }
- else if (land == 5){
- inv_Country = toolsInvUkr;
- }
- else if (land == 6){
- inv_Country = toolsInvChi;
- }
- if (inv_Country >= 38 && inv_Country <= 50){
- price = toolsPrice[land] + randomnum;
- }
- else if (inv_Country >= 26 && inv_Country <= 37){
- price = toolsPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 13 && inv_Country <= 25){
- price = toolsPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 12){
- price = toolsPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 50){
- price = toolsPrice[land] * 0.75 + randomnum;
- }
- priceArrays[5] = price;
- }
- else if (goodType == 6){
- if (land == 0){
- inv_Country = spiceInvSwede;
- }
- else if (land == 1){
- inv_Country = spiceInvPol;
- }
- else if (land == 2){
- inv_Country = spiceInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = spiceInvCri;
- }
- else if (land == 4){
- inv_Country = spiceInvSau;
- }
- else if (land == 5){
- inv_Country = spiceInvUkr;
- }
- else if (land == 6){
- inv_Country = spiceInvChi;
- }
- if (inv_Country >= 24 && inv_Country <= 30){
- price = spicePrice[land] + randomnum;
- }
- else if (inv_Country >= 16 && inv_Country <= 23){
- price = spicePrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 9 && inv_Country <= 15){
- price = spicePrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 8){
- price = spicePrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 30){
- price = spicePrice[land] * 0.75 + randomnum;
- }
- priceArrays[6] = price;
- }
- else if (goodType == 7){
- if (land == 0){
- inv_Country = ironInvSwede;
- }
- else if (land == 1){
- inv_Country = ironInvPol;
- }
- else if (land == 2){
- inv_Country = ironInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = ironInvCri;
- }
- else if (land == 4){
- inv_Country = ironInvSau;
- }
- else if (land == 5){
- inv_Country = ironInvUkr;
- }
- else if (land == 6){
- inv_Country = ironInvChi;
- }
- if (inv_Country >= 76 && inv_Country <= 100){
- price = ironPrice[land] + randomnum;
- }
- else if (inv_Country >= 51 && inv_Country <= 75){
- price = ironPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 26 && inv_Country <= 50){
- price = ironPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 25){
- price = ironPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 100){
- price = ironPrice[land] * 0.75 + randomnum;
- }
- priceArrays[7] = price;
- }
- else if (goodType == 8){
- if (land == 0){
- inv_Country = flourInvSwede;
- }
- else if (land == 1){
- inv_Country = flourInvPol;
- }
- else if (land == 2){
- inv_Country = flourInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = flourInvCri;
- }
- else if (land == 4){
- inv_Country = flourInvSau;
- }
- else if (land == 5){
- inv_Country = flourInvUkr;
- }
- else if (land == 6){
- inv_Country = flourInvChi;
- }
- if (inv_Country >= 114 && inv_Country <= 150){
- price = flourPrice[land] + randomnum;
- }
- else if (inv_Country >= 76 && inv_Country <= 113){
- price = flourPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 39 && inv_Country <= 75){
- price = flourPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 38){
- price = flourPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 150){
- price = flourPrice[land] * 0.75 + randomnum;
- }
- priceArrays[8] = price;
- }
- else if (goodType == 9){
- if (land == 0){
- inv_Country = dyeInvSwede;
- }
- else if (land == 1){
- inv_Country = dyeInvPol;
- }
- else if (land == 2){
- inv_Country = dyeInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = dyeInvCri;
- }
- else if (land == 4){
- inv_Country = dyeInvSau;
- }
- else if (land == 5){
- inv_Country = dyeInvUkr;
- }
- else if (land == 6){
- inv_Country = dyeInvChi;
- }
- if (inv_Country >= 57 && inv_Country <= 75){
- price = dyePrice[land] + randomnum;
- }
- else if (inv_Country >= 40 && inv_Country <= 56){
- price = dyePrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 20 && inv_Country <= 39){
- price = dyePrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 19){
- price = dyePrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 75){
- price = dyePrice[land] * 0.75 + randomnum;
- }
- priceArrays[9] = price;
- }
- else if (goodType == 10){
- if (land == 0){
- inv_Country = leatherInvSwede;
- }
- else if (land == 1){
- inv_Country = leatherInvPol;
- }
- else if (land == 2){
- inv_Country = leatherInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = leatherInvCri;
- }
- else if (land == 4){
- inv_Country = leatherInvSau;
- }
- else if (land == 5){
- inv_Country = leatherInvUkr;
- }
- else if (land == 6){
- inv_Country = leatherInvChi;
- }
- if (inv_Country >= 57 && inv_Country <= 75){
- price = leatherPrice[land] + randomnum;
- }
- else if (inv_Country >= 39 && inv_Country <= 56){
- price = leatherPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 20 && inv_Country <= 38){
- price = leatherPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 19){
- price = leatherPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 75){
- price = leatherPrice[land] * 0.75 + randomnum;
- }
- priceArrays[10] = price;
- }
- else if (goodType == 11){
- if (land == 0){
- inv_Country = furInvSwede;
- }
- else if (land == 1){
- inv_Country = furInvPol;
- }
- else if (land == 2){
- inv_Country = furInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = furInvCri;
- }
- else if (land == 4){
- inv_Country = furInvSau;
- }
- else if (land == 5){
- inv_Country = furInvUkr;
- }
- else if (land == 6){
- inv_Country = furInvChi;
- }
- if (inv_Country >= 57 && inv_Country <= 75){
- price = furPrice[land] + randomnum;
- }
- else if (inv_Country >= 40 && inv_Country <= 56){
- price = furPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 20 && inv_Country <= 39){
- price = furPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 19){
- price = furPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 75){
- price = furPrice[land] * 0.75 + randomnum;
- }
- priceArrays[11] = price;
- }
- else if (goodType == 12){
- if (land == 0){
- inv_Country = beerInvSwede;
- }
- else if (land == 1){
- inv_Country = beerInvPol;
- }
- else if (land == 2){
- inv_Country = beerInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = beerInvCri;
- }
- else if (land == 4){
- inv_Country = beerInvSau;
- }
- else if (land == 5){
- inv_Country = beerInvUkr;
- }
- else if (land == 6){
- inv_Country = beerInvChi;
- }
- if (inv_Country >= 57 && inv_Country <= 75){
- price = beerPrice[land] + randomnum;
- }
- else if (inv_Country >= 40 && inv_Country <= 56){
- price = beerPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 20 && inv_Country <= 39){
- price = beerPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 19){
- price = beerPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 75){
- price = beerPrice[land] * 0.75 + randomnum;
- }
- priceArrays[12] = price;
- }else if (goodType == 13){
- if (land == 0){
- inv_Country = saltInvSwede;
- }
- else if (land == 1){
- inv_Country = saltInvPol;
- }
- else if (land == 2){
- inv_Country = saltInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = saltInvCri;
- }
- else if (land == 4){
- inv_Country = saltInvSau;
- }
- else if (land == 5){
- inv_Country = saltInvUkr;
- }
- else if (land == 6){
- inv_Country = saltInvChi;
- }
- if (inv_Country >= 57 && inv_Country <= 75){
- price = saltPrice[land] + randomnum;
- }
- else if (inv_Country >= 40 && inv_Country <= 56){
- price = saltPrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 20 && inv_Country <= 39){
- price = saltPrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 19){
- price = saltPrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 50){
- price = saltPrice[land] * 0.75 + randomnum;
- }
- priceArrays[13] = price;
- }
- else if (goodType == 14){
- if (land == 0){
- inv_Country = wineInvSwede;
- }
- else if (land == 1){
- inv_Country = wineInvPol;
- }
- else if (land == 2){
- inv_Country = wineInvRus;
- }
- //changes
- else if (land == 3){
- inv_Country = wineInvCri;
- }
- else if (land == 4){
- inv_Country = wineInvSau;
- }
- else if (land == 5){
- inv_Country = wineInvUkr;
- }
- else if (land == 6){
- inv_Country = wineInvChi;
- }
- if (inv_Country >= 57 && inv_Country <= 75){
- price = winePrice[land] + randomnum;
- }
- else if (inv_Country >= 40 && inv_Country <= 56){
- price = winePrice[land] * 1.25 + randomnum;
- }
- else if (inv_Country >= 20 && inv_Country <= 39){
- price = winePrice[land] * 1.50 + randomnum;
- }
- else if (inv_Country <= 19){
- price = winePrice[land] * 2 + randomnum;
- }
- else if (inv_Country > 75){
- price = winePrice[land] * 0.75 + randomnum;
- }
- priceArrays[14] = price;
- }
- cout << "[" << i << "] " << tradeGoods[goodType] << " - Eur " << price;
- cout << endl;
- goodType++;
- }
- }
- float random(float x){
- srand(time(0));
- x = rand() % 20 + (-20);
- return x;
- }
- //inv country function
- void determineCountry(void){
- if (land == 0){
- if (goodType == 0) inv_Country = potInvSwede;
- // //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
- else if (goodType == 1) inv_Country = oilInvSwede;
- //addition
- else if (goodType == 2) inv_Country = fishInvSwede;
- else if (goodType == 3) inv_Country = woolInvSwede;
- else if (goodType == 4) inv_Country = velvetInvSwede;
- else if (goodType == 5) inv_Country = toolsInvSwede;
- else if (goodType == 6) inv_Country = spiceInvSwede;
- else if (goodType == 7) inv_Country = ironInvSwede;
- else if (goodType == 8) inv_Country = flourInvSwede;
- else if (goodType == 9) inv_Country = dyeInvSwede;
- else if (goodType == 10) inv_Country = leatherInvSwede;
- else if (goodType == 11) inv_Country = furInvSwede;
- else if (goodType == 12) inv_Country = beerInvSwede;
- else if (goodType == 13) inv_Country = saltInvSwede;
- else if (goodType == 14) inv_Country = wineInvSwede;
- }
- else if (land == 1){
- if (goodType == 0) inv_Country = potInvPol;
- else if (goodType == 1) inv_Country = oilInvPol;
- else if (goodType == 2) inv_Country = fishInv;
- else if (goodType == 3) inv_Country = woolInvPol;
- else if (goodType == 4) inv_Country = velvetInvPol;
- else if (goodType == 5) inv_Country = toolsInvPol;
- else if (goodType == 6) inv_Country = spiceInvPol;
- else if (goodType == 7) inv_Country = ironInvPol;
- else if (goodType == 8) inv_Country = flourInvPol;
- else if (goodType == 9) inv_Country = dyeInvPol;
- else if (goodType == 10) inv_Country = leatherInvPol;
- else if (goodType == 11) inv_Country = furInvPol;
- else if (goodType == 12) inv_Country = beerInvPol;
- else if (goodType == 13) inv_Country = saltInvPol;
- else if (goodType == 14) inv_Country = wineInvPol;
- }
- else if (land == 2){
- if (goodType == 0) inv_Country = potInvRus;
- else if (goodType == 1) inv_Country = oilInvRus;
- else if (goodType == 2) inv_Country = fishInvRus;
- else if (goodType == 3) inv_Country = woolInvRus;
- else if (goodType == 4) inv_Country = velvetInvRus;
- else if (goodType == 5) inv_Country = toolsInvRus;
- else if (goodType == 6) inv_Country = spiceInvRus;
- else if (goodType == 7) inv_Country = ironInvRus;
- else if (goodType == 8) inv_Country = flourInvRus;
- else if (goodType == 9) inv_Country = dyeInvRus;
- else if (goodType == 10) inv_Country = leatherInvRus;
- else if (goodType == 11) inv_Country = furInvRus;
- else if (goodType == 12) inv_Country = beerInvRus;
- else if (goodType == 13) inv_Country = saltInvRus;
- else if (goodType == 14) inv_Country = wineInvRus;
- }
- //changes
- else if (land == 3){
- if (goodType == 0) inv_Country = potInvCri;
- else if (goodType == 1) inv_Country = oilInvCri;
- else if (goodType == 2) inv_Country = fishInvCri;
- else if (goodType == 3) inv_Country = woolInvCri;
- else if (goodType == 4) inv_Country = velvetInvCri;
- else if (goodType == 5) inv_Country = toolsInvCri;
- else if (goodType == 6) inv_Country = spiceInvCri;
- else if (goodType == 7) inv_Country = ironInvCri;
- else if (goodType == 8) inv_Country = flourInvCri;
- else if (goodType == 9) inv_Country = dyeInvCri;
- else if (goodType == 10) inv_Country = leatherInvCri;
- else if (goodType == 11) inv_Country = furInvCri;
- else if (goodType == 12) inv_Country = beerInvCri;
- else if (goodType == 13) inv_Country = saltInvCri;
- else if (goodType == 14) inv_Country = wineInvCri;
- }
- else if (land == 4){
- if (goodType == 0) inv_Country = potInvSau;
- else if (goodType == 1) inv_Country = oilInvSau;
- else if (goodType == 2) inv_Country = fishInvSau;
- else if (goodType == 3) inv_Country = woolInvSau;
- else if (goodType == 4) inv_Country = velvetInvSau;
- else if (goodType == 5) inv_Country = toolsInvSau;
- else if (goodType == 6) inv_Country = spiceInvSau;
- else if (goodType == 7) inv_Country = ironInvSau;
- else if (goodType == 8) inv_Country = flourInvSau;
- else if (goodType == 9) inv_Country = dyeInvSau;
- else if (goodType == 10) inv_Country = leatherInvSau;
- else if (goodType == 11) inv_Country = furInvSau;
- else if (goodType == 12) inv_Country = beerInvSau;
- else if (goodType == 13) inv_Country = saltInvSau;
- else if (goodType == 14) inv_Country = wineInvSau;
- }
- else if (land == 5){
- if (goodType == 0) inv_Country = potInvUkr;
- else if (goodType == 1) inv_Country = oilInvUkr;
- else if (goodType == 2) inv_Country = fishInvUkr;
- else if (goodType == 3) inv_Country = woolInvUkr;
- else if (goodType == 4) inv_Country = velvetInvUkr;
- else if (goodType == 5) inv_Country = toolsInvUkr;
- else if (goodType == 6) inv_Country = spiceInvUkr;
- else if (goodType == 7) inv_Country = ironInvUkr;
- else if (goodType == 8) inv_Country = flourInvUkr;
- else if (goodType == 9) inv_Country = dyeInvUkr;
- else if (goodType == 10) inv_Country = leatherInvUkr;
- else if (goodType == 11) inv_Country = furInvUkr;
- else if (goodType == 12) inv_Country = beerInvUkr;
- else if (goodType == 13) inv_Country = saltInvUkr;
- else if (goodType == 14) inv_Country = wineInvUkr;
- }
- else if (land == 6){
- if (goodType == 0) inv_Country = potInvChi;
- else if (goodType == 1) inv_Country = oilInvChi;
- else if (goodType == 2) inv_Country = fishInvChi;
- else if (goodType == 3) inv_Country = woolInvChi;
- else if (goodType == 4) inv_Country = velvetInvChi;
- else if (goodType == 5) inv_Country = toolsInvChi;
- else if (goodType == 6) inv_Country = spiceInvChi;
- else if (goodType == 7) inv_Country = ironInvChi;
- else if (goodType == 8) inv_Country = flourInvChi;
- else if (goodType == 9) inv_Country = dyeInvChi;
- else if (goodType == 10) inv_Country = leatherInvChi;
- else if (goodType == 11) inv_Country = furInvChi;
- else if (goodType == 12) inv_Country = beerInvChi;
- else if (goodType == 13) inv_Country = saltInvChi;
- else if (goodType == 14) inv_Country = wineInvChi;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement