Skip to content

Commit 6507e4f

Browse files
committed
Added Prices to menus
1 parent d000fc2 commit 6507e4f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

monopoly.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ bool financial_menue(player &p){
788788
std::cout<<colorCodes[p.color].first << p.symbol << " " << p.name << RESET_COLOR << "here are the cards you can mortgage:" <<std::endl;
789789
int i = 0;
790790
for(tile t : filteredTileListPlayer){
791-
std::cout<<colorCodes[t.color].first << std::string(i < 10 ? "0" : "") << i << " | " << t.tileName << RESET_COLOR <<std::endl;
791+
std::cout<<colorCodes[t.color].first << std::string(i < 10 ? "0" : "") << i << " | " << "$" << t.buyPrice*0.5 << std::string(t.buyPrice*0.5 < 100 ? " " : "") << " | " << t.tileName << RESET_COLOR <<std::endl;
792792
i++;
793793
}
794794
std::cout<< "99 | Finished in this menue" <<std::endl;
@@ -826,7 +826,7 @@ bool financial_menue(player &p){
826826
std::cout<<colorCodes[p.color].first << p.symbol << " " << p.name << RESET_COLOR << "here are the cards you can unmortgage:" <<std::endl;
827827
int i = 0;
828828
for(tile t : filteredTileListPlayer){
829-
std::cout<<colorCodes[t.color].first << std::string(i < 10 ? "0" : "") << i << " | " << t.tileName << RESET_COLOR <<std::endl;
829+
std::cout<<colorCodes[t.color].first << std::string(i < 10 ? "0" : "") << i << " | " << "$" << t.buyPrice*0.55 << std::string(t.buyPrice*0.55 < 100 ? " " : "") << " | " << t.tileName << RESET_COLOR <<std::endl;
830830
i++;
831831
}
832832
std::cout<< "99 | Finished in this menue" <<std::endl;
@@ -886,7 +886,7 @@ bool building_menue(player &p){
886886
if(!p.ownedStreets.empty()){
887887
for(int i : p.ownedStreets){
888888
if(ownsMonopoly(gameBoard[i])){
889-
if(gameBoard[i].upgradeStage != 5){
889+
if(gameBoard[i].upgradeStage != 5 && !gameBoard[i].isMortgaged && gameBoard[i].housePrice != 0){
890890
filteredTileListPlayer.push_back(gameBoard[i].tileIndex);
891891
}
892892
}
@@ -899,7 +899,7 @@ bool building_menue(player &p){
899899
std::cout<<colorCodes[p.color].first << p.symbol << " " << p.name << RESET_COLOR << "here are the cards you can upgrade:" <<std::endl;
900900
int i = 0;
901901
for(int t : filteredTileListPlayer){
902-
std::cout<<colorCodes[gameBoard[t].color].first << std::string(i < 10 ? "0" : "") << i << " | " << gameBoard[t].tileName << RESET_COLOR <<std::endl;
902+
std::cout<<colorCodes[gameBoard[t].color].first << std::string(i < 10 ? "0" : "") << i << " | " << "$" << gameBoard[t].housePrice << std::string(gameBoard[t].housePrice < 100 ? " " : "") << " | " << gameBoard[t].tileName << RESET_COLOR <<std::endl;
903903
i++;
904904
}
905905
std::cout<< "99 | Finished in this menue" <<std::endl;
@@ -938,7 +938,7 @@ bool building_menue(player &p){
938938
if(!p.ownedStreets.empty()){
939939
for(int i : p.ownedStreets){
940940
if(ownsMonopoly(gameBoard[i])){
941-
if(gameBoard[i].upgradeStage != 0){
941+
if(gameBoard[i].upgradeStage != 0 && !gameBoard[i].isMortgaged && gameBoard[i].housePrice != 0){
942942
filteredTileListPlayer.push_back(gameBoard[i].tileIndex);
943943
}
944944
}
@@ -951,7 +951,7 @@ bool building_menue(player &p){
951951
std::cout<<colorCodes[p.color].first << p.symbol << " " << p.name << RESET_COLOR << "here are the cards you can downgrade:" <<std::endl;
952952
int i = 0;
953953
for(int t : filteredTileListPlayer){
954-
std::cout<<colorCodes[gameBoard[t].color].first << std::string(i < 10 ? "0" : "") << i << " | " << gameBoard[t].tileName << RESET_COLOR <<std::endl;
954+
std::cout<<colorCodes[gameBoard[t].color].first << std::string(i < 10 ? "0" : "") << i << " | " << "$" << gameBoard[t].housePrice*0.5 << std::string(gameBoard[t].housePrice*0.5 < 100 ? " " : "") << " | " << gameBoard[t].tileName << RESET_COLOR <<std::endl;
955955
i++;
956956
}
957957
std::cout<< "99 | Finished in this menue" <<std::endl;

0 commit comments

Comments
 (0)