Skip to content

Commit

Permalink
Agreement bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
aybarsaltinisik committed Dec 20, 2020
1 parent 6e6fdc6 commit 93deea6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/models/TakePercentage.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
public class TakePercentage extends ContiuousOffer {
// properties
private City city;
private double percentage;
private int percentage;

// constructor
public TakePercentage(City city, double percentage){
public TakePercentage(City city, int percentage){
this.city = city;
this.percentage = percentage;
}

@Override
public void performOffer(Player firstPlayer, Player secondPlayer) {
// get percentage of rent from secondPlayers city
firstPlayer.addMoney(city.getRent() * percentage);
secondPlayer.addMoney(city.getRent() * (1 - percentage));
double rate = ((double)percentage)/10;
firstPlayer.addMoney(city.getRent() * rate);
secondPlayer.addMoney(city.getRent() * (1 - rate));
}

@Override
Expand Down

0 comments on commit 93deea6

Please sign in to comment.