Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Hill committed Apr 7, 2017
2 parents fee894a + f97939a commit 5cacacf
Show file tree
Hide file tree
Showing 40 changed files with 51 additions and 13 deletions.
3 changes: 3 additions & 0 deletions bin/.gitignore
@@ -1 +1,4 @@
/.DS_Store
/controller/
/model/
/view/
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
Binary file modified bin/model/BigDealStack.class
Binary file not shown.
Binary file modified bin/model/Card.class
Binary file not shown.
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/DealCard.class
Binary file not shown.
Binary file modified bin/model/DealTile.class
Binary file not shown.
Binary file modified bin/model/Die.class
Binary file not shown.
Binary file modified bin/model/DoodadCard.class
Binary file not shown.
Binary file modified bin/model/DoodadStack.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/GameBoard.class
Binary file not shown.
Binary file modified bin/model/MarketCard.class
Binary file not shown.
Binary file modified bin/model/MarketStack.class
Binary file not shown.
Binary file modified bin/model/MarketTile.class
Binary file not shown.
Binary file modified bin/model/OwnedRealEstate.class
Binary file not shown.
Binary file modified bin/model/PaydayTile.class
Binary file not shown.
Binary file modified bin/model/Player.class
Binary file not shown.
Binary file modified bin/model/Profession.class
Binary file not shown.
Binary file modified bin/model/Professions.class
Binary file not shown.
Binary file modified bin/model/SmallDealStack.class
Binary file not shown.
Binary file modified bin/model/Stock.class
Binary file not shown.
Binary file modified bin/model/Tile.class
Binary file not shown.
Binary file modified bin/model/TileCircularLinkedList$Node.class
Binary file not shown.
Binary file modified bin/model/TileCircularLinkedList.class
Binary file not shown.
Binary file modified bin/view/MainWindow$1.class
Binary file not shown.
Binary file modified bin/view/MainWindow.class
Binary file not shown.
Binary file modified bin/view/MainWindow1$1.class
Binary file not shown.
Binary file modified bin/view/MainWindow1.class
Binary file not shown.
Binary file modified bin/view/Window.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();

}

}
5 changes: 3 additions & 2 deletions src/model/DealTile.java
Expand Up @@ -29,15 +29,16 @@ public class DealTile extends Tile
Card c;
if(input.equals("1"))
{
c = _smallDealStack.pickCard()
c = _smallDealStack.pickCard();
}
else
{
c = _smallDealStack.pickCard();
}

// If stock, update price, then ask user if they want to buy and ask everyone if they want to sell:
if(c.getTitle().equals(anObject))
//if(c.getTitle().equals(anObject))

// If property, ask user if they want to do it (and check if they can afford the down payment):
// If yes, call ButIncomeProperty method:
// Else, do nothing:
Expand Down
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 5cacacf

Please sign in to comment.