Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of
https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git

Conflicts:
	bin/.gitignore
	bin/controller/Cashflow.class
	bin/view/GameboardWindow.class
	bin/view/TileButton.class
	src/view/MainMenu.java
  • Loading branch information
afortuna2016 committed Apr 22, 2017
2 parents 162cbc3 + 196db52 commit f409fd0
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 15 deletions.
7 changes: 7 additions & 0 deletions bin/.gitignore
@@ -1,8 +1,15 @@
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
======= =======
>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git
/.DS_Store /.DS_Store
/controller/ /controller/
/model/ /model/
<<<<<<< HEAD
>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git >>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git
/view/ /view/
/Instructions.class /Instructions.class
=======
/view/
>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
Binary file modified bin/view/GameboardWindow.class
Binary file not shown.
Binary file modified bin/view/TileButton.class
Binary file not shown.
10 changes: 8 additions & 2 deletions src/controller/Cashflow.java
@@ -1,15 +1,21 @@
package controller; package controller;


import view.*; import view.*;

import java.util.ArrayList;

import model.*; import model.*;


public class Cashflow public class Cashflow
{ {




private GameBoard _board; private GameBoard _board;
private Player[] _players; public Player[] players;
//private CardStack[] _cards; //private CardStack[] _cards;
public GameboardWindow gameboard;
public static int numPlayers;





public static void go() public static void go()
Expand Down Expand Up @@ -50,7 +56,7 @@ public class Cashflow
public boolean isWinner() public boolean isWinner()
{ {
boolean isWinner = false; boolean isWinner = false;
for(Player p : _players) for(Player p : players)
{ {
if(p.hasWon()) if(p.hasWon())
{ {
Expand Down
2 changes: 1 addition & 1 deletion src/model/Player.java
Expand Up @@ -6,7 +6,7 @@ public class Player
private boolean _donate; private boolean _donate;
private int _charityCount; //charity counter private int _charityCount; //charity counter
private int _downsizeCount; //down size counter private int _downsizeCount; //down size counter
private int _location; private int _location;//refers to a tile number
private boolean _hasWon; private boolean _hasWon;


public Player() public Player()
Expand Down
25 changes: 13 additions & 12 deletions src/view/GameboardWindow.java
@@ -1,27 +1,27 @@
package view; package view;
import model.*; import model.*;
import java.awt.Dimension; import controller.*;
import java.awt.Graphics; import java.awt.*;
import java.awt.Image;

import java.awt.Point;
import java.awt.geom.Path2D;
import java.util.ArrayList; import java.util.ArrayList;


import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JPanel; import javax.swing.JPanel;


import controller.Cashflow;

public class GameboardWindow extends JPanel { public class GameboardWindow extends JPanel {



private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Image img = new ImageIcon(this.getClass().getResource( private Image img = new ImageIcon(this.getClass().getResource(
"gameboard.png")).getImage(); "gameboard.png")).getImage();


private GameBoard board; // private GameBoard board;
private Point[] points = new Point[24]; private Point[] points = new Point[24];


private ArrayList<Positioner> Positioners; private ArrayList<Positioner> Positioners;



public GameboardWindow(GameBoard board) { public GameboardWindow(GameBoard board) {
this.board = board; this.board = board;
Dimension size = new Dimension(img.getWidth(null), img.getHeight(null)); Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
Expand All @@ -45,6 +45,7 @@ public class GameboardWindow extends JPanel {
public void setUpTiles() { public void setUpTiles() {
// implement the tiles into the graphical boardspace // implement the tiles into the graphical boardspace
// the buttons are going to be a little off as i couldnt figure out how to rotate jbuttons // the buttons are going to be a little off as i couldnt figure out how to rotate jbuttons
// i guess it doesnt really matter what tile is which but the position matters - 0 is starting
TileButton t1 = new TileButton("Deal", 0, board); TileButton t1 = new TileButton("Deal", 0, board);
this.add(t1); this.add(t1);
t1.setBounds(125,532,95,20); //xstart,ystart,width,height t1.setBounds(125,532,95,20); //xstart,ystart,width,height
Expand Down Expand Up @@ -182,11 +183,10 @@ public class GameboardWindow extends JPanel {


} }


public void update(ArrayList<Integer> locP) { public void update() { //updates the location of the player on the board
for (int i = 0; i < locP.size(); i++) { for (int i = 0; i < Cashflow.numPlayers; i++) {
int x = (int) points[locP.get(i)].getX(); int x = (int) points[Player[i].getLocation()].getX(); // i will fix this later
int y = (int) points[locP.get(i)].getY(); int y = (int) points[Player[i].getLocation()].getY(); // hopefully lol

Positioners.get(i).setX(x); Positioners.get(i).setX(x);
Positioners.get(i).setY(y); Positioners.get(i).setY(y);


Expand All @@ -197,4 +197,5 @@ public class GameboardWindow extends JPanel {







} }
101 changes: 101 additions & 0 deletions src/view/MainMenu.java
Expand Up @@ -3,6 +3,7 @@ package view;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;


import javax.swing.*; import javax.swing.*;
<<<<<<< HEAD


import controller.Cashflow; import controller.Cashflow;
import model.Instructions; import model.Instructions;
Expand Down Expand Up @@ -132,3 +133,103 @@ public class MainMenu




}} }}
=======
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class MainMenu
{
public static void main (String[] args)
{
JFrame frame = new JFrame("CashFlow");

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(650,530);
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
int x = (int) ((dimension.getWidth() - frame.getWidth()) / 2);
int y = (int) ((dimension.getHeight() - frame.getHeight()) / 2) -100;
frame.setLocation(x, y);

JPanel panel1 = new JPanel();
panel1.setSize(140, 45);
panel1.setLocation(255, 125);
panel1.setOpaque(false);
//Font font = new Font ("Times New Roman", Font.BOLD, 30);
//panel1.setFont(font);

JPanel panel2 = new JPanel();
panel2.setSize(140, 45);
panel2.setLocation(255, 160);
panel2.setOpaque(false);

JPanel panel3 = new JPanel();
panel3.setSize(140, 45);
panel3.setLocation(255, 260);
panel3.setOpaque(false);

JPanel panel4 = new JPanel();
panel4.setSize(140, 45);
panel4.setLocation(255, 295);
panel4.setOpaque(false);

JPanel panel5 = new JPanel();
panel5.setSize(140, 45);
panel5.setLocation(255, 330);
panel5.setOpaque(false);


JButton newGame = new JButton("New Game");
JButton savedGame = new JButton("Saved Game");
JButton rules = new JButton("Rules");
JButton settings = new JButton("Settings");
JButton exit = new JButton("Exit");

newGame.setPreferredSize(new Dimension(140,40));
newGame.setForeground(Color.MAGENTA);

savedGame.setPreferredSize(new Dimension(130,40));
savedGame.setForeground(Color.MAGENTA);


rules.setPreferredSize(new Dimension(80,40));
rules.setForeground(Color.MAGENTA);


settings.setPreferredSize(new Dimension(120,40));
settings.setForeground(Color.MAGENTA);


exit.setPreferredSize(new Dimension(100,40));
exit.setForeground(Color.MAGENTA);


BufferedImage img = null;
try {
img = ImageIO.read(new File("gameboard.png"));
} catch (IOException e) {
e.printStackTrace();
}
Image dimg = img.getScaledInstance(800, 508, Image.SCALE_SMOOTH);
ImageIcon imageIcon = new ImageIcon(dimg);
frame.setContentPane(new JLabel(imageIcon));
frame.getContentPane().add(new JLabel(imageIcon));


panel1.add(newGame);
panel2.add(savedGame);
panel3.add(rules);
panel4.add(settings);
panel5.add(exit);

frame.add(panel1);
frame.add(panel2);
frame.add(panel3);
frame.add(panel4);
frame.add(panel5);
frame.setVisible(true);

}
}
>>>>>>> branch 'master' of https://github.uconn.edu/joh13010/2102-Group-Project-Spring-2017.git

0 comments on commit f409fd0

Please sign in to comment.