Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Just tryna pull
  • Loading branch information
Joe Hill committed Apr 14, 2017
2 parents f277afe + 53c88af commit 7576eda
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 78 deletions.
2 changes: 2 additions & 0 deletions bin/.gitignore
@@ -1 +1,3 @@
/controller/
/model/
/view/
Binary file modified bin/model/GameBoard.class
Binary file not shown.
Binary file modified bin/view/MainWindow1$1.class
Binary file not shown.
Binary file modified bin/view/MainWindow1.class
Binary file not shown.
26 changes: 23 additions & 3 deletions src/model/GameBoard.java
Expand Up @@ -11,9 +11,29 @@ public class GameBoard
private TileCircularLinkedList _tiles;

private static Tile t1 = new DealTile("Deal Tile", 0);
private static Tile t2 = new DealTile("Doodad", 1);
private static Tile t3 = new DealTile("Deal", 2);
private static Tile t4 = new DealTile("Charity", 3);
private static Tile t2 = new MarketTile("Market Tile", 1);
private static Tile t3 = new DealTile("Deal Tile", 2);
private static Tile t4 = new PaydayTile("Payday Tile", 3);
private static Tile t5 = new DealTile("Deal Tile", 4);
private static Tile t6 = new DownsizeTile("Downsize", 5);
private static Tile t7 = new DealTile("Deal Tile", 6);
private static Tile t8 = new DoodadTile("Doodad Tile", 7);
private static Tile t9 = new DealTile("Deal Tile", 8);
private static Tile t10 = new MarketTile("Market Tile", 9);
private static Tile t11 = new DealTile("Deal Tile", 10);
private static Tile t12 = new PaydayTile("Payday Tile", 11);
private static Tile t13 = new DealTile("Deal Tile", 12);
private static Tile t14 = new CharityTile("Charity Tile", 13);
private static Tile t15 = new DealTile("Deal Tile", 14);
private static Tile t16 = new DoodadTile("Doodad Tile", 15);
private static Tile t17 = new DealTile("Deal Tile", 16);
private static Tile t18 = new MarketTile("Market Tile", 17);
private static Tile t19 = new DealTile("Deal Tile", 18);
private static Tile t20 = new PaydayTile("Payday Tile", 19);
private static Tile t21 = new DealTile("Deal Tile", 20);
private static Tile t22 = new ChildTile("Child Tile", 21);
private static Tile t23 = new DealTile("Deal Tile", 22);
private static Tile t24 = new DoodadTile("Doodad Tile", 23);


public GameBoard(Player... players)
Expand Down
75 changes: 0 additions & 75 deletions src/view/DownSizeWindow

This file was deleted.

File renamed without changes.
88 changes: 88 additions & 0 deletions src/view/GameboardWindow.java
@@ -0,0 +1,88 @@
package view;
import model.*;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;

import java.awt.Point;

import java.util.ArrayList;

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

public class GameboardWindow extends JPanel {

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

private GameBoard board; //
private Point[] points = new Point[40];// location of topleft corner of
// buttons

private ArrayList<Positioner> Positioners;

public GameboardWindow(GameBoard board) {
this.board = board;
Dimension size = new Dimension(img.getWidth(null)+250, img.getHeight(null));
setPreferredSize(size);
setMinimumSize(size);
setMaximumSize(size);
setSize(size);
setLayout(null);

setUpTiles();

Positioners = new ArrayList<Positioner>();
for (int i = 1; i <= 4; i++) {
String path = "piece" + i + ".png";
Image img = new ImageIcon(this.getClass().getResource(path))
.getImage();
Positioners.add(new Positioner(img, 602, 602));
}
}

public void setUpTiles() {
// implement the tiles into the graphical boardspace??
// Tile t1;
// this.add(t1);
// t1.setBounds(133,521,50,75); //xstart,ystart,width,height
// points[1] = newPoint(133,521);


// LocationButton b2 = new LocationButton("name", 21, board);
// this.add(b2);
// b2.setBounds(98, 10, 56, 88);// xStart, Ystart, width, height
// points[21] = new Point(98, 10);



}

public void paintComponent(Graphics g) {
g.drawImage(img, 0, 0, null);

for (int i = 0; i < Positioners.size(); i++) {
Positioner curr = Positioners.get(i);
g.drawImage(curr.getImage(), curr.getX(), curr.getY(), null);
}

}

public void update(ArrayList<Integer> locP) {
for (int i = 0; i < locP.size(); i++) {
int x = (int) points[locP.get(i)].getX();
int y = (int) points[locP.get(i)].getY();

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

}

}




}
4 changes: 4 additions & 0 deletions src/view/MainWindow1.java
Expand Up @@ -9,6 +9,10 @@ import javax.swing.border.EmptyBorder;

public class MainWindow1 extends JFrame {

/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel contentPane;

/**
Expand Down
38 changes: 38 additions & 0 deletions src/view/Positioner.java
@@ -0,0 +1,38 @@
package view;

import java.awt.Image;

public class Positioner {

private Image img;
private int x, y;
public Positioner(Image img, int x, int y){
this.img = img;
this.x = x;
this.y = y;
}

public int getX(){
return this.x;
}

public int getY(){
return this.y;
}

public Image getImage(){
return this.img;
}

public void setX(int x2){
this.x = x2;
}

public void setY(int y){
this.y = y;
}

public void setImage(Image newImage){
this.img = newImage;
}
}
Binary file added src/view/gameboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/view/piece1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/view/piece2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/view/piece3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/view/piece4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7576eda

Please sign in to comment.