diff --git a/bin/.gitignore b/bin/.gitignore index 1f65b37..2255885 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1 +1,8 @@ +<<<<<<< HEAD +======= +/.DS_Store +/controller/ +/model/ +>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git /view/ +/Instructions.class diff --git a/bin/controller/Cashflow.class b/bin/controller/Cashflow.class index 1704d34..88b07e4 100644 Binary files a/bin/controller/Cashflow.class and b/bin/controller/Cashflow.class differ diff --git a/bin/model/CardStack.class b/bin/model/CardStack.class index ce4fd7a..1a7713a 100644 Binary files a/bin/model/CardStack.class and b/bin/model/CardStack.class differ diff --git a/bin/model/Handler.class b/bin/model/Handler.class deleted file mode 100644 index 3a3c5f5..0000000 Binary files a/bin/model/Handler.class and /dev/null differ diff --git a/bin/view/TileButton.class b/bin/view/TileButton.class index 7b840b9..4cdaa25 100644 Binary files a/bin/view/TileButton.class and b/bin/view/TileButton.class differ diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index fde4514..b57c1d8 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -11,17 +11,10 @@ public class Cashflow private Player[] _players; //private CardStack[] _cards; - public static void main(String[] args) - { - /* - * Just testing stuff in here for now. Main method will call the go() method when game is built - */ - testGamePlay(); - - } - public void go() + public static void go() { + System.out.println("Start game"); // Joe // Initialize game board // Initialize GUI diff --git a/src/model/Handler.java b/src/model/Handler.java deleted file mode 100644 index 8515231..0000000 --- a/src/model/Handler.java +++ /dev/null @@ -1,25 +0,0 @@ -package model; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - - -public class Handler implements ActionListener { - private int rent, price, locationOnBoard; - private Tile tile; - - public Handler(int price, int rent, Tile tile, int locationOnBoard, - GameBoard board) { - this.price = price; - this.rent = rent; - this.tile = tile; - this.locationOnBoard = locationOnBoard; - - } - - public void actionPerformed(ActionEvent event) { - // refer to getLandedOn? Or one of the decision/card windows? How do i do this i am tired - - } - -} diff --git a/src/model/Instructions.java b/src/model/Instructions.java new file mode 100644 index 0000000..665cdb8 --- /dev/null +++ b/src/model/Instructions.java @@ -0,0 +1,10 @@ +package model; + +public class Instructions +{ + public static void getClicked() + { + System.out.println("You thought we were just going to GIVE you the instructions?"); + System.out.println("HAHAHAHAH"); + } +} diff --git a/src/view/MainMenu.java b/src/view/MainMenu.java index a9b25e3..d5b97c3 100644 --- a/src/view/MainMenu.java +++ b/src/view/MainMenu.java @@ -1,8 +1,15 @@ package view; import javax.imageio.ImageIO; + import javax.swing.*; + +import controller.Cashflow; +import model.Instructions; + import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; @@ -11,7 +18,7 @@ public class MainMenu { public static void main (String[] args) { - JFrame frame = new JFrame("CashFlow"); + final JFrame frame = new JFrame("CashFlow"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(650,530); @@ -96,7 +103,32 @@ public class MainMenu frame.add(panel3); frame.add(panel4); frame.add(panel5); - frame.setVisible(true); + frame.setVisible(true); - } -} + newGame.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + frame.dispose(); + Cashflow.go(); + } + }); + + rules.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + frame.dispose(); + Instructions.getClicked(); + } + }); + + exit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.exit(0); + } + }); + + + + + + + +}} diff --git a/src/view/TileButton.java b/src/view/TileButton.java index c3c06c8..3aafc82 100644 --- a/src/view/TileButton.java +++ b/src/view/TileButton.java @@ -11,7 +11,6 @@ public class TileButton extends JButton { private static final long serialVersionUID = 1L; private Tile tile; - private int rent, price; public TileButton(String name, int TileOnBoard, GameBoard board) { super(name); @@ -20,27 +19,11 @@ public class TileButton extends JButton { // this.setOpaque(false); this.setContentAreaFilled(false); // this.setBorderPainted(false); - - this.setInts(); this.setVisible(true); - Handler hand = new Handler(price, rent, tile, TileOnBoard, - board); - this.addActionListener(hand); } - public void setInts() { - - if (this.tile instanceof Tile) { - /* - * i dont actually really like this method - * but i think it should be like that iterator in cash flow - * that determines moving over the tiles and if it's landed on - * the gui should be brought up already in the handler method - */ - } - } public void paint(Graphics g) { // Do nothing here }