Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
main menu
  • Loading branch information
amf14004 committed Apr 21, 2017
2 parents c175f75 + 597b3db commit 4795507
Show file tree
Hide file tree
Showing 34 changed files with 294 additions and 63 deletions.
3 changes: 0 additions & 3 deletions bin/.gitignore
@@ -1,4 +1 @@
/.DS_Store
/controller/
/model/
/view/
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
Binary file modified bin/model/DoodadTile.class
Binary file not shown.
Binary file modified bin/model/DownsizeTile.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/Tile.class
Binary file not shown.
Binary file modified bin/model/TileCircularLinkedList.class
Binary file not shown.
Binary file modified bin/view/CharityWindow$2.class
Binary file not shown.
Binary file modified bin/view/CharityWindow$3.class
Binary file not shown.
Binary file modified bin/view/CharityWindow.class
Binary file not shown.
Binary file modified bin/view/DoodadCardWindow$1.class
Binary file not shown.
Binary file modified bin/view/DoodadCardWindow$2.class
Binary file not shown.
Binary file modified bin/view/DoodadCardWindow.class
Binary file not shown.
Binary file modified bin/view/DownSizeWindow.class
Binary file not shown.
Binary file modified bin/view/FSWindow.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 added gameboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/controller/Cashflow.java
Expand Up @@ -69,9 +69,12 @@ public class Cashflow

private static void testGamePlay()
{
Player p = new Player();
System.out.println(p.getFinancialStatement().getProfession().getName());
GameBoard g = new GameBoard();
Player p1 = new Player();
Player p2 = new Player();
GameBoard g = new GameBoard(p1, p2);
System.out.println(p1.getLocation());
g.movePlayer(p1, 5);
System.out.println(p1.getLocation());

}

Expand Down
6 changes: 6 additions & 0 deletions src/model/DoodadTile.java
@@ -1,5 +1,7 @@
package model;

import view.*;

public class DoodadTile extends Tile
{
private static DoodadStack _doodadStack;
Expand All @@ -15,6 +17,10 @@ public class DoodadTile extends Tile
{
FinancialStatement f = p.getFinancialStatement();
DoodadCard dc = _doodadStack.pickCard();

DoodadCardWindow DoodadCardWindow = new DoodadCardWindow();
DoodadCardWindow.showButtonDemo();

int amount = dc.getValue();
if (f.getCashBalance() > amount)
{
Expand Down
8 changes: 8 additions & 0 deletions src/model/DownsizeTile.java
@@ -1,5 +1,7 @@
package model;

import view.DownSizeWindow;

public class DownsizeTile extends Tile{
public DownsizeTile(String type, int boardIndex)
{
Expand All @@ -10,5 +12,11 @@ public class DownsizeTile extends Tile{
public void getLandedOn(Player p)
{
p.increaseDownsizeCount();

DownSizeWindow DownSizeWindow = new DownSizeWindow();
DownSizeWindow.showButtonDemo();

// TODO
System.out.println("Player landed on downsized");
}
}
110 changes: 100 additions & 10 deletions src/model/FinancialStatement.java
Expand Up @@ -205,27 +205,117 @@ public class FinancialStatement
return _totalIncome;
}

public int getSalary()
<<<<<<< HEAD

=======
//income getters
public int getIncome()
{
return _income;
}
public int getSalary()
{
return _salary;
}
public int getREcashFlow()
{
return _REcashFlow;
}

public int getSalary()
//expense getters
public int getExpenses()
{
return _salary;
return _expenses;
}
public int getTaxes()
{
return _taxes;
}
public int getHomeMortgagePayment()
{
return _homeMortgagePayment;
}
public int getSchoolLoanPayment()
{
return _schoolLoanPayment;
}
public int getCarLoanPayment()
{
return _carLoanPayment;
}
public int getCreditCardPayment()
{
return _creditCardPayment;
}
public int getOtherExpenses()
{
return _otherExpenses;
}
public int getPerChildExpense()
{
return _perChildExpense;
}
public int getNumChildren()
{
return _numChildren;
}

public int getSalary()
//assets getters
public int getAssets()
{
return _salary;
}
public int getSalary()
return _assets;
}
public int getSavings()
{
return _salary;
return _savings;
}
public int getSalary()

public int getStock()
{
return _salary;
return _stock.getNumShares() * _stock.getSharePrice();
}
//for realestate,maybe
// public int get()
// {
// return _;
// }

//liabilities getters
public int getLiabilities()
{
return _liabilities;
}
public int getHomeMortgage()
{
return _homeMortgage;
}
public int getSchoolLoans()
{
return _schoolLoans;
}
public int getCarLoans()
{
return _carLoans;
}
public int getCreditCardDebt()
{
return _creditCardDebt;
}

//additonal cash flow getters
public int getMonthlySalary()
{
return _monthlySalary;
}

public int getTotalExpenses()
{
return _totalExpenses;
}

public int getMonthlyCashflow() {
// TODO Auto-generated method stub
return _monthlyCashFlow;
}

}
Expand Down
17 changes: 9 additions & 8 deletions src/model/GameBoard.java
Expand Up @@ -41,16 +41,13 @@ public class GameBoard
{
_profs = new Professions();
_tiles = new TileCircularLinkedList();
_tiles.addTiles(t1, t2, t3, t4);
_tiles.addTiles(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24);
t1.addPlayers(players);
}
public Tile getTile(int num) {
ArrayList<Tile> tileList = new ArrayList<Tile>();
Tile[] tileList1 = {
t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24
};
tileList.addAll(Arrays.asList(tileList1));
return tileList.get(num);


public Tile getTile(int index) {
return _tiles.get(index).getData();
}

// TODO This method will move the player and returns the number of pay days they passed along the way.
Expand All @@ -70,6 +67,10 @@ public class GameBoard
{
passedPaydays++;
}

// TODO update player location on board each iteration and maybe add delay
System.out.println("Player is at tile number: " + currentNode.getData().getBoardIndex());

currentNode = nextNode;
}
currentNode.getData().addPlayers(p);
Expand Down
1 change: 1 addition & 0 deletions src/model/Stock.java
Expand Up @@ -35,4 +35,5 @@ public class Stock
return _numShares;
}


}
1 change: 1 addition & 0 deletions src/model/Tile.java
Expand Up @@ -10,6 +10,7 @@ public class Tile

public Tile(String name, int boardIndex)
{
_players = new ArrayList<Player>();
_name = name;
_boardIndex = boardIndex;
}
Expand Down
4 changes: 2 additions & 2 deletions src/model/TileCircularLinkedList.java
Expand Up @@ -64,7 +64,7 @@ public class TileCircularLinkedList
return null;
}
Node n = head;
while(index-1!=0){
while(index!=0){
n=n.next;
index--;
}
Expand All @@ -76,7 +76,7 @@ public class TileCircularLinkedList
return null;
}
Node n = head;
while(index-1!=0){
while(index!=0){
n=n.next;
index--;
}
Expand Down
Binary file added src/view/.DS_Store
Binary file not shown.
10 changes: 3 additions & 7 deletions src/view/CharityWindow.java
Expand Up @@ -59,25 +59,21 @@ public class CharityWindow {

Donate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//put message that they donated xx dollars after 10 seconds, close window
//update cashbalance for player
try {
Thread.sleep(1000);
Thread.sleep(1);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

statusLabel.setText("Good Job! You donated all your savings!");


System.exit(0);
}
});

DontDonate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//put message that they are greedy. after 10 seconds, close window
System.exit(0);
System.exit(0);
}
});
controlPanel.add(Donate);
Expand Down
8 changes: 5 additions & 3 deletions src/view/DoodadCardWindow.java
Expand Up @@ -16,20 +16,22 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import model.DoodadCard;

public class DoodadCardWindow {
private JFrame mainFrame;
private JLabel headerLabel;
private JLabel statusLabel;
private JPanel controlPanel;

public DoodadCardWindow(){
prepareGUI();
prepareGUI(null);
}
public static void main(String[] args){
DoodadCardWindow DoodadCardWindow = new DoodadCardWindow();
DoodadCardWindow.showButtonDemo();
}
private void prepareGUI(){
private void prepareGUI(DoodadCard dc){
mainFrame = new JFrame("Doodad");
mainFrame.getContentPane().setBackground(new Color(250, 51, 51));
mainFrame.setSize(350,250);
Expand All @@ -56,7 +58,7 @@ public class DoodadCardWindow {
mainFrame.setVisible(true);
}

private void showButtonDemo(){
public void showButtonDemo(){
headerLabel.setText("Call Doodad Title here");
statusLabel.setText("Call Doodad Description here");
//resources folder should be inside SWING folder.
Expand Down
2 changes: 1 addition & 1 deletion src/view/DownSizeWindow.java
Expand Up @@ -54,7 +54,7 @@ public class DownSizeWindow {
mainFrame.setVisible(true);
}

private void showButtonDemo(){
public void showButtonDemo(){
headerLabel.setText("Downsize");
statusLabel.setText("You lose 3 turns.");
//resources folder should be inside SWING folder.
Expand Down

0 comments on commit 4795507

Please sign in to comment.