Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tilesssss, had to change a few ints to doubles and added/changed a bunch
of getters and setters, i dont't think i changed anything that affected
the rest of the game though
  • Loading branch information
afortuna2016 committed Apr 6, 2017
1 parent b90e6c8 commit f97939a
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 11 deletions.
Binary file modified bin/model/CardStack.class
Binary file not shown.
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.
Binary file modified bin/model/Player.class
Binary file not shown.
1 change: 1 addition & 0 deletions src/model/CardStack.java
@@ -1,6 +1,7 @@
package model;

import java.util.ArrayList;

import java.util.LinkedList;
import java.util.Random;
import java.util.Stack;
Expand Down
18 changes: 13 additions & 5 deletions src/model/CharityTile.java
Expand Up @@ -12,13 +12,21 @@ public class CharityTile extends Tile
@Override
public void getLandedOn(Player p)
{

// TODO
// Ask players if they want to donate to charity (returns boolean)
// If true:
// Set players charity coutner to 3
// Take money from them (check board for deets)
// else:
// Nothin

if (p.donateCharity())
{
p.setCharityCount(p.getCharityCount() + 3);
p.getFinancialStatement().setCashBalance(p.getFinancialStatement().getCashBalance()
- (p.getFinancialStatement().getPassiveIncome()*.10));
}
else
{
//you're an asshole
}

}

}
3 changes: 2 additions & 1 deletion src/model/ChildTile.java
Expand Up @@ -11,7 +11,8 @@ public class ChildTile extends Tile
@Override
public void getLandedOn(Player p)
{
// Increment child counter using addChild() method in financial statement
p.getFinancialStatement().addChild();

}

}
13 changes: 12 additions & 1 deletion src/model/DoodadTile.java
Expand Up @@ -3,7 +3,8 @@ package model;
public class DoodadTile extends Tile
{
private static DoodadStack _doodadStack;

private DoodadCard card;
private int amount;

public DoodadTile(String name, int boardIndex)
{
Expand All @@ -14,6 +15,16 @@ public class DoodadTile extends Tile
@Override
public void getLandedOn(Player p)
{
card = (DoodadCard) _doodadStack.pop();
amount = card.getValue();
if (p.getFinancialStatement().getCashBalance() > amount)
{
p.getFinancialStatement().setCashBalance(p.getFinancialStatement().getCashBalance() - amount);
}
else if(p.getFinancialStatement().getCashBalance() < amount)
{
p.getFinancialStatement().setCashBalance(0);
}
// Pop next card
// Get cash out from card
// Check if player has enough money to pay in full
Expand Down
7 changes: 6 additions & 1 deletion src/model/FinancialStatement.java
Expand Up @@ -107,7 +107,7 @@ public class FinancialStatement
// TODO add method to update display if its currently being displayed
}

private int getPassiveIncome()
int getPassiveIncome()
{
int passiveInc = 0;
for(OwnedRealEstate re : _realEstate)
Expand Down Expand Up @@ -184,6 +184,11 @@ public class FinancialStatement
return _cashBalance;
}

public void setCashBalance(double d)
{
_cashBalance = (int) d;
}

public void increaseCashBalance(int cashIncrease)
{
this._cashBalance =+ cashIncrease;
Expand Down
14 changes: 11 additions & 3 deletions src/model/Player.java
Expand Up @@ -3,6 +3,7 @@ package model;
public class Player
{
private FinancialStatement _fs;
private boolean _donate;
private int _charityCount; //charity counter
private int _downsizeCount; //down size counter
private int _location;
Expand Down Expand Up @@ -31,8 +32,11 @@ public class Player

public boolean donateCharity()
{
//
return false;
return _donate;
}
public void setCharity(boolean charityq)
{
_donate = charityq;
}

public void setLocation(int i)
Expand All @@ -51,7 +55,11 @@ public class Player
return _charityCount;
}


public void setCharityCount(int charityCount)
{
_charityCount = charityCount;
}

public void decrementCharityCount()
{
_charityCount--;
Expand Down

0 comments on commit f97939a

Please sign in to comment.