diff --git a/bin/model/CharityTile.class b/bin/model/CharityTile.class index d52244e..ef1cf02 100644 Binary files a/bin/model/CharityTile.class and b/bin/model/CharityTile.class differ diff --git a/bin/model/ChildTile.class b/bin/model/ChildTile.class index 1c2f52b..58a4266 100644 Binary files a/bin/model/ChildTile.class and b/bin/model/ChildTile.class differ diff --git a/bin/model/DoodadTile.class b/bin/model/DoodadTile.class index aab4fc1..a960f1a 100644 Binary files a/bin/model/DoodadTile.class and b/bin/model/DoodadTile.class differ diff --git a/bin/model/FinancialStatement.class b/bin/model/FinancialStatement.class index b527dce..883bcda 100644 Binary files a/bin/model/FinancialStatement.class and b/bin/model/FinancialStatement.class differ diff --git a/src/model/CharityTile.java b/src/model/CharityTile.java index 35d4f34..4d85163 100644 --- a/src/model/CharityTile.java +++ b/src/model/CharityTile.java @@ -13,14 +13,11 @@ public class CharityTile extends Tile public void getLandedOn(Player p) { - // TODO - // Ask players if they want to donate to charity (returns boolean) if (p.donateCharity()) { p.setCharityCount(p.getCharityCount() + 3); - p.getFinancialStatement().setCashBalance(p.getFinancialStatement().getCashBalance() - - (p.getFinancialStatement().getPassiveIncome()*.10)); + p.getFinancialStatement().increaseCashBalance((int) -((p.getFinancialStatement().getTotalIncome()*.1))); } else { diff --git a/src/model/ChildTile.java b/src/model/ChildTile.java index bdc42fa..c9bdbf5 100644 --- a/src/model/ChildTile.java +++ b/src/model/ChildTile.java @@ -12,6 +12,7 @@ public class ChildTile extends Tile public void getLandedOn(Player p) { p.getFinancialStatement().addChild(); + p.getFinancialStatement().update(); } diff --git a/src/model/DoodadTile.java b/src/model/DoodadTile.java index 89ac791..5190806 100644 --- a/src/model/DoodadTile.java +++ b/src/model/DoodadTile.java @@ -20,10 +20,12 @@ public class DoodadTile extends Tile if (p.getFinancialStatement().getCashBalance() > amount) { p.getFinancialStatement().setCashBalance(p.getFinancialStatement().getCashBalance() - amount); + p.getFinancialStatement().update(); } else if(p.getFinancialStatement().getCashBalance() < amount) { p.getFinancialStatement().setCashBalance(0); + p.getFinancialStatement().update(); } // Pop next card // Get cash out from card diff --git a/src/model/FinancialStatement.java b/src/model/FinancialStatement.java index 0b8ece4..cbd79a0 100644 --- a/src/model/FinancialStatement.java +++ b/src/model/FinancialStatement.java @@ -91,7 +91,7 @@ public class FinancialStatement update(); } - private void update() + public void update() { _income = _salary + _REcashFlow; _expenses = _taxes + _homeMortgagePayment + _schoolLoanPayment + _carLoanPayment + _creditCardPayment + _otherExpenses + (_perChildExpense * _numChildren); @@ -199,6 +199,10 @@ public class FinancialStatement { return _profession; } + public int getTotalIncome() + { + return _totalIncome; + } }