From 8f7a4a72738b748bc8c4509602f1d04cd1c0b5c3 Mon Sep 17 00:00:00 2001 From: afortuna2016 Date: Fri, 7 Apr 2017 11:43:18 -0400 Subject: [PATCH 1/7] tilessss --- bin/model/CharityTile.class | Bin 879 -> 833 bytes bin/model/ChildTile.class | Bin 621 -> 651 bytes bin/model/DoodadTile.class | Bin 1047 -> 1090 bytes bin/model/FinancialStatement.class | Bin 4557 -> 4635 bytes src/model/CharityTile.java | 5 +---- src/model/ChildTile.java | 1 + src/model/DoodadTile.java | 2 ++ src/model/FinancialStatement.java | 6 +++++- 8 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/model/CharityTile.class b/bin/model/CharityTile.class index d52244e9b809f4950740fec9adb142c48a94a0a1..ef1cf0258729324c4afb881c3d241a5d122c9431 100644 GIT binary patch delta 200 zcmaFQc94zh)W2Q(7#J9g7)&>EU1l^1$uCLF@ytuk&rM~s-#HTmW^pm7GwAU!=rbrX zG6-kpB^RY87NjOHSotP-oELVbEoeWn>UYPb~>Z zEH2J0OZCi4&d*I{v)?%r1ZII$8S()28#6NS6{nUU8NkTEqT!+$Hd&BqYkfTfI|CEY z9zE@C3?efbG_`@W6kEbJ200)@352&XsI^0A?RF6cz3lXD3|$RNfb%OK961*CNuYw42%qBKsGZ2BeyP)Z4P8J HF<1Zq)o3u; diff --git a/bin/model/ChildTile.class b/bin/model/ChildTile.class index 1c2f52b6d80bd140725df2a83ee1ef4dfbf265a3..58a4266b7d5cd4ef9daff4c14db69b9f24e806ca 100644 GIT binary patch delta 130 zcmaFM(#^_s>ff$?3=9lL4C))XN*RT@7^E2#c^H%!ff$?3=9lL3@RJBN*O0lVqEO)z`)4B1Qg@Y-o_xZjX`Q7kj=!v1tht^ n;(QG33<3nD%AqHLsVFn2X5e78|F$OE3j3bce!XU{I#30QO#UR6w$e;`qVF1d4UBDoz!XO3Y e0v*HP094G#-~?o|F);mRaFGG>oPj(h1{VN%`zJ#H delta 162 zcmX@aF`a|!)W2Q(7#J9g7@Rh8RWVJT&UA}&9Ro816HqKs0 zG3ae$Fwxq=ptFd98^q(=#$dS-sF0aK97rlLZ~#dm23`hX1_=fc1~mpT1}mV9Es*EU sAjJ^Opa^6!07b!uGe`o(Kp+ID!j6HF!5+wFVPLWq1+pE0Y$gUr0LAkdu>b%7 diff --git a/bin/model/FinancialStatement.class b/bin/model/FinancialStatement.class index b527dce92127679951eddfe19e01aa8236cfc3df..883bcda6406f7bdb2f79a44694813391dc3af421 100644 GIT binary patch delta 140 zcmX@BJX?k9)W2Q(7#J9g7(Q;~dd0!dm!4V@l3$XT 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 diff --git a/src/model/FinancialStatement.java b/src/model/FinancialStatement.java index 0b8ece4..cbd79a0 100644 --- a/src/model/FinancialStatement.java +++ b/src/model/FinancialStatement.java @@ -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); @@ -199,6 +199,10 @@ public class FinancialStatement { return _profession; } + public int getTotalIncome() + { + return _totalIncome; + } } From 4260e1aa016bde6ca680240c6235685f1a8555ea Mon Sep 17 00:00:00 2001 From: afortuna2016 Date: Fri, 7 Apr 2017 11:51:19 -0400 Subject: [PATCH 2/7] todo --- bin/model/CharityTile.class | Bin 833 -> 833 bytes src/model/CharityTile.java | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/model/CharityTile.class b/bin/model/CharityTile.class index ef1cf0258729324c4afb881c3d241a5d122c9431..587dac09b5c10cad8fe03d7057bdfb5485e8050d 100644 GIT binary patch delta 25 gcmX@ec93lYD>JVU13QBVgCK(_gBpX(WFcmK06n+^zyJUM delta 25 gcmX@ec93lYD>JVk13QB-gCK(lgBpYMWFcmK06mNYyZ`_I diff --git a/src/model/CharityTile.java b/src/model/CharityTile.java index 4d85163..0b92dd8 100644 --- a/src/model/CharityTile.java +++ b/src/model/CharityTile.java @@ -12,7 +12,8 @@ public class CharityTile extends Tile @Override public void getLandedOn(Player p) { - + //call view method + // TODO if (p.donateCharity()) { From 669e3100a1d9cdce10c564b47f1c222e742f5945 Mon Sep 17 00:00:00 2001 From: Vidhi Pandit Date: Fri, 7 Apr 2017 12:04:32 -0400 Subject: [PATCH 3/7] Create CharityCard.java This is the charity card pop up --- src/view/CharityCard.java | 94 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/view/CharityCard.java diff --git a/src/view/CharityCard.java b/src/view/CharityCard.java new file mode 100644 index 0000000..75f5bfd --- /dev/null +++ b/src/view/CharityCard.java @@ -0,0 +1,94 @@ +package view; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +public class CharityCard { + private JFrame mainFrame; + private JLabel headerLabel; + private JLabel statusLabel; + private JPanel controlPanel; + + public CharityCard(){ + prepareGUI(); + } + public static void main(String[] args){ + CharityCard CharityCard = new CharityCard(); + CharityCard.showButtonDemo(); + } + private void prepareGUI(){ + mainFrame = new JFrame("Charity"); + mainFrame.setSize(400,250); + //need to set this to null and position everything manually + mainFrame.setLayout(new GridLayout(3, 1)); + + mainFrame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent windowEvent){ + System.exit(0); + } + }); + headerLabel = new JLabel("", JLabel.CENTER); + statusLabel = new JLabel("",JLabel.CENTER); + //new statuslabel of "10% of your whatever is XX dollars" + statusLabel.setSize(350,100); + + controlPanel = new JPanel(); + controlPanel.setLayout(new FlowLayout()); + + mainFrame.add(headerLabel); + mainFrame.add(controlPanel); + mainFrame.add(statusLabel); + mainFrame.setVisible(true); + } + private static ImageIcon createImageIcon(String path, String description) { + java.net.URL imgURL = CharityCard.class.getResource(path); + if (imgURL != null) { + return new ImageIcon(imgURL, description); + } else { + System.err.println("Couldn't find file: " + path); + return null; + } + } + private void showButtonDemo(){ + headerLabel.setText("Charity!"); + statusLabel.setText("Charity description"); + + //resources folder should be inside SWING folder. + ImageIcon icon = createImageIcon("/resources/java_icon.png","Java"); + + JButton Donate = new JButton("Donate"); + + JButton DontDonate = new JButton("Don't Donate", icon); + DontDonate.setHorizontalTextPosition(SwingConstants.LEFT); + + Donate.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //put message that they donated xx dollars after 10 seconds, close window + try { + Thread.sleep(1000); + } 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); + } + }); + controlPanel.add(Donate); + + controlPanel.add(DontDonate); + + mainFrame.setVisible(true); + } +} From ca85919c9fe32d96db64254e8585ae69fd2c95ed Mon Sep 17 00:00:00 2001 From: Sara S Saulat Date: Fri, 7 Apr 2017 12:09:40 -0400 Subject: [PATCH 4/7] Create DealCard.java --- src/view/DealCard.java | 103 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/view/DealCard.java diff --git a/src/view/DealCard.java b/src/view/DealCard.java new file mode 100644 index 0000000..6a0d78c --- /dev/null +++ b/src/view/DealCard.java @@ -0,0 +1,103 @@ +package view; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import model.*; + +public class DealCard { + private JFrame mainFrame; + private JLabel headerLabel; + private JLabel statusLabel; + private JPanel controlPanel; + private JFrame mainFrame2; + private JLabel headerLabel2; + private JLabel statusLabel2; + private JPanel controlPanel2; + public int response; + + public DealCard(){ + prepareGUI(); + } + public static void main(String[] args){ + DealCard DealCard = new DealCard(); + DealCard.showButtonDemo(); + } + private void prepareGUI(){ + mainFrame = new JFrame("Deal"); + mainFrame.setSize(400,250); + //need to set this to null and position everything manually + mainFrame.setLayout(new GridLayout(3, 1)); + + mainFrame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent windowEvent){ + System.exit(0); + } + }); + headerLabel = new JLabel("", JLabel.CENTER); + statusLabel = new JLabel("",JLabel.CENTER); + //new statuslabel of "10% of your whatever is XX dollars" + statusLabel.setSize(350,100); + + controlPanel = new JPanel(); + controlPanel.setLayout(new FlowLayout()); + + mainFrame.add(headerLabel); + mainFrame.add(controlPanel); + mainFrame.add(statusLabel); + mainFrame.setVisible(true); + + mainFrame2 = new JFrame("Deal"); + mainFrame2.setSize(400,250); + //need to set this to null and position everything manually + mainFrame2.setLayout(new GridLayout(3, 1)); + + mainFrame2.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent windowEvent){ + System.exit(0); + } + }); + headerLabel2 = new JLabel("", JLabel.CENTER); + statusLabel2 = new JLabel("",JLabel.CENTER); + //new statusLabel2 of "10% of your whatever is XX dollars" + statusLabel2.setSize(350,100); + + controlPanel2 = new JPanel(); + controlPanel2.setLayout(new FlowLayout()); + + mainFrame2.add(headerLabel2); + mainFrame2.add(controlPanel2); + mainFrame2.add(statusLabel2); + mainFrame2.setVisible(true); + } + + private int showButtonDemo(){ + + headerLabel.setText("Deal"); + statusLabel.setText("What type of deal would you like?"); + + //resources folder should be inside SWING folder. + + JButton BigDeal = new JButton("BigDeal"); + JButton SmallDeal = new JButton("SmallDeal"); + SmallDeal.setHorizontalTextPosition(SwingConstants.LEFT); + + BigDeal.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //open big deal stuffs + response = 1; + } + + }); + + SmallDeal.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + response = 0; + } + }); + controlPanel.add(BigDeal); + controlPanel.add(SmallDeal); + mainFrame.setVisible(true); + return response; + } +} From 345d0f57d4598e346c6976c3dee6d9c3bf6c8bc5 Mon Sep 17 00:00:00 2001 From: Sara S Saulat Date: Fri, 7 Apr 2017 12:09:55 -0400 Subject: [PATCH 5/7] Create ChildCard.java --- src/view/ChildCard.java | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/view/ChildCard.java diff --git a/src/view/ChildCard.java b/src/view/ChildCard.java new file mode 100644 index 0000000..19eec34 --- /dev/null +++ b/src/view/ChildCard.java @@ -0,0 +1,71 @@ +package view; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +public class ChildCard { + + private JFrame mainFrame; + private JLabel headerLabel; + private JLabel statusLabel; + private JPanel controlPanel; + + public ChildCard(){ + prepareGUI(); + } + public static void main(String[] args){ + ChildCard ChildCard = new ChildCard(); + ChildCard.showButtonDemo(); + } + private void prepareGUI(){ + mainFrame = new JFrame("Child"); + mainFrame.setSize(400,250); + //need to set this to null and position everything manually + mainFrame.setLayout(new GridLayout(3, 1)); + + mainFrame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent windowEvent){ + System.exit(0); + } + }); + headerLabel = new JLabel("", JLabel.CENTER); + statusLabel = new JLabel("",JLabel.CENTER); + statusLabel.setSize(350,100); + + controlPanel = new JPanel(); + controlPanel.setLayout(new FlowLayout()); + + mainFrame.add(headerLabel); + mainFrame.add(controlPanel); + mainFrame.add(statusLabel); + mainFrame.setVisible(true); + } + + private void showButtonDemo(){ + headerLabel.setText("Child"); + statusLabel.setText("You have a child!"); + + //resources folder should be inside SWING folder. + + JButton Child = new JButton("Exit"); + + Child.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + Thread.sleep(1000); + } catch (InterruptedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + statusLabel.setText(""); + + System.exit(0); + } + }); + + controlPanel.add(Child); + mainFrame.setVisible(true); + } +} From 6afa0781c075a9debae9a3bd8b6a880dc557813f Mon Sep 17 00:00:00 2001 From: Sara S Saulat Date: Fri, 7 Apr 2017 12:10:13 -0400 Subject: [PATCH 6/7] Create DoodadCard.java --- src/view/DoodadCard.java | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/view/DoodadCard.java diff --git a/src/view/DoodadCard.java b/src/view/DoodadCard.java new file mode 100644 index 0000000..cec2a5e --- /dev/null +++ b/src/view/DoodadCard.java @@ -0,0 +1,79 @@ +package view; + +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.SwingConstants; + +public class DoodadCard { + private JFrame mainFrame; + private JLabel headerLabel; + private JLabel statusLabel; + private JPanel controlPanel; + + public DoodadCard(){ + prepareGUI(); + } + public static void main(String[] args){ + DoodadCard DoodadCard = new DoodadCard(); + DoodadCard.showButtonDemo(); + } + private void prepareGUI(){ + mainFrame = new JFrame("Doodad"); + mainFrame.setSize(400,250); + //need to set this to null and position everything manually + mainFrame.setLayout(new GridLayout(3, 1)); + + mainFrame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent windowEvent){ + System.exit(0); + } + }); + headerLabel = new JLabel("", JLabel.CENTER); + statusLabel = new JLabel("",JLabel.CENTER); + statusLabel.setSize(350,100); + + controlPanel = new JPanel(); + controlPanel.setLayout(new FlowLayout()); + + mainFrame.add(headerLabel); + mainFrame.add(controlPanel); + mainFrame.add(statusLabel); + mainFrame.setVisible(true); + } + + private void showButtonDemo(){ + headerLabel.setText("Call Doodad Title here"); + statusLabel.setText("Call Doodad Description here"); + //resources folder should be inside SWING folder. + + JButton payDoodad = new JButton("Pay"); + // payDoodad.setLayout(null); + // payDoodad.setLocation(10,220); + payDoodad.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //put message that they payDoodad xx dollars after 10 seconds, close window + try { + Thread.sleep(1000); + } catch (InterruptedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + // statusLabel.setText("whatever now equals xx dollars"); + System.exit(0); + } + }); + + controlPanel.add(payDoodad); + mainFrame.setVisible(true); + } +} From 9a99d87e056f02529d89edfee3d0e691f3aba086 Mon Sep 17 00:00:00 2001 From: Sara S Saulat Date: Fri, 7 Apr 2017 12:10:37 -0400 Subject: [PATCH 7/7] Create SDStockCard.java --- src/view/SDStockCard.java | 84 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/view/SDStockCard.java diff --git a/src/view/SDStockCard.java b/src/view/SDStockCard.java new file mode 100644 index 0000000..4f0e3f7 --- /dev/null +++ b/src/view/SDStockCard.java @@ -0,0 +1,84 @@ +package view; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +public class SDStockCard { + private JFrame mainFrame; + private JLabel headerLabel; + private JLabel statusLabel; + private JPanel controlPanel; + + public SDStockCard(){ + prepareGUI(); + } + public static void main(String[] args){ + SDStockCard SDStockCard = new SDStockCard(); + SDStockCard.showButtonDemo(); + } + private void prepareGUI(){ + mainFrame = new JFrame("Small Deal"); + mainFrame.setSize(400,250); + //need to set this to null and position everything manually + mainFrame.setLayout(new GridLayout(3, 1)); + + mainFrame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent windowEvent){ + System.exit(0); + } + }); + headerLabel = new JLabel("", JLabel.CENTER); + statusLabel = new JLabel("",JLabel.CENTER); + statusLabel.setSize(350,100); + + controlPanel = new JPanel(); + controlPanel.setLayout(new FlowLayout()); + + mainFrame.add(headerLabel); + mainFrame.add(controlPanel); + mainFrame.add(statusLabel); + mainFrame.setVisible(true); + } + + private void showButtonDemo(){ + headerLabel.setText("Small Deal Stock Title"); + statusLabel.setText("Small Deal Stock Description"); + + //resources folder should be inside SWING folder. + + JTextField BuyStock = new JTextField(); + BuyStock.setPreferredSize(new Dimension(25, 25)); + + JButton NoStocks = new JButton("Don't Buy Stocks"); + NoStocks.setHorizontalTextPosition(SwingConstants.LEFT); + + BuyStock.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //put message that they BuyStockd xx dollars after 10 seconds, close window + try { + Thread.sleep(1000); + } catch (InterruptedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + statusLabel.setText("You bought xx stocks"); + + + System.exit(0); + } + }); + + NoStocks.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //put message that they are greedy. after 10 seconds, close window + System.exit(0); + } + }); + + controlPanel.add(BuyStock); + controlPanel.add(NoStocks); + mainFrame.setVisible(true); + } +}