Skip to content
Permalink
Browse files

main menu

  • Loading branch information
amf14004 committed Apr 21, 2017
2 parents c175f75 + 597b3db commit 47955078418614bce6e3dfb0144a3651e91a0419
@@ -1,4 +1 @@
/.DS_Store
/controller/
/model/
/view/
BIN -42 Bytes (98%) bin/controller/Cashflow.class
Binary file not shown.
BIN +149 Bytes (110%) bin/model/DoodadTile.class
Binary file not shown.
BIN +308 Bytes (160%) bin/model/DownsizeTile.class
Binary file not shown.
BIN -194 Bytes (96%) bin/model/FinancialStatement.class
Binary file not shown.
BIN -111 Bytes (97%) bin/model/GameBoard.class
Binary file not shown.
BIN +20 Bytes (100%) bin/model/Tile.class
Binary file not shown.
Binary file not shown.
BIN -206 Bytes (82%) bin/view/CharityWindow$2.class
Binary file not shown.
BIN +0 Bytes (100%) bin/view/CharityWindow$3.class
Binary file not shown.
BIN -107 Bytes (96%) bin/view/CharityWindow.class
Binary file not shown.
BIN +24 Bytes (100%) bin/view/DoodadCardWindow$1.class
Binary file not shown.
BIN +0 Bytes (100%) bin/view/DoodadCardWindow$2.class
Binary file not shown.
BIN +61 Bytes (100%) bin/view/DoodadCardWindow.class
Binary file not shown.
BIN +0 Bytes (100%) bin/view/DownSizeWindow.class
Binary file not shown.
BIN +1.13 KB (120%) bin/view/FSWindow.class
Binary file not shown.
BIN +0 Bytes (100%) bin/view/MainWindow$1.class
Binary file not shown.
BIN +0 Bytes (100%) bin/view/MainWindow.class
Binary file not shown.
BIN +297 KB gameboard.png
Binary file not shown.
@@ -69,9 +69,12 @@ public boolean isWinner()

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());

}

@@ -1,5 +1,7 @@
package model;

import view.*;

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

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

int amount = dc.getValue();
if (f.getCashBalance() > amount)
{
@@ -1,5 +1,7 @@
package model;

import view.DownSizeWindow;

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

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

// TODO
System.out.println("Player landed on downsized");
}
}
@@ -205,27 +205,117 @@ public int getTotalIncome()
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;
}

}
@@ -41,16 +41,13 @@ public GameBoard(Player... players)
{
_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.
@@ -70,6 +67,10 @@ public int movePlayer(Player p, int distance)
{
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);
@@ -35,4 +35,5 @@ public int getNumShares()
return _numShares;
}


}
@@ -10,6 +10,7 @@

public Tile(String name, int boardIndex)
{
_players = new ArrayList<Player>();
_name = name;
_boardIndex = boardIndex;
}
@@ -64,7 +64,7 @@ public Node get(int index){
return null;
}
Node n = head;
while(index-1!=0){
while(index!=0){
n=n.next;
index--;
}
@@ -76,7 +76,7 @@ public Tile elementAt(int index){
return null;
}
Node n = head;
while(index-1!=0){
while(index!=0){
n=n.next;
index--;
}
BIN +6 KB src/view/.DS_Store
Binary file not shown.
@@ -59,25 +59,21 @@ private void showButtonDemo(){

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);
@@ -16,20 +16,22 @@
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);
@@ -56,7 +58,7 @@ public void windowClosing(WindowEvent windowEvent){
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.
@@ -54,7 +54,7 @@ private void prepareGUI(){
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.

0 comments on commit 4795507

Please sign in to comment.
You can’t perform that action at this time.