Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tilessss
  • Loading branch information
afortuna2016 committed Apr 7, 2017
1 parent f97939a commit 8f7a4a7
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5 deletions.
Binary file modified bin/model/CharityTile.class
Binary file not shown.
Binary file modified bin/model/ChildTile.class
Binary file not shown.
Binary file modified bin/model/DoodadTile.class
Binary file not shown.
Binary file modified bin/model/FinancialStatement.class
Binary file not shown.
5 changes: 1 addition & 4 deletions src/model/CharityTile.java
Expand Up @@ -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
{
Expand Down
1 change: 1 addition & 0 deletions src/model/ChildTile.java
Expand Up @@ -12,6 +12,7 @@ public class ChildTile extends Tile
public void getLandedOn(Player p)
{
p.getFinancialStatement().addChild();
p.getFinancialStatement().update();

}

Expand Down
2 changes: 2 additions & 0 deletions src/model/DoodadTile.java
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/model/FinancialStatement.java
Expand Up @@ -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);
Expand Down Expand Up @@ -199,6 +199,10 @@ public class FinancialStatement
{
return _profession;
}
public int getTotalIncome()
{
return _totalIncome;
}
}


Expand Down

0 comments on commit 8f7a4a7

Please sign in to comment.