diff --git a/bin/controller/Cashflow.class b/bin/controller/Cashflow.class index e57c612..0dfa4b1 100644 Binary files a/bin/controller/Cashflow.class and b/bin/controller/Cashflow.class differ diff --git a/bin/view/GameboardWindow.class b/bin/view/GameboardWindow.class index 06f8a0b..dceacd1 100644 Binary files a/bin/view/GameboardWindow.class and b/bin/view/GameboardWindow.class differ diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index fde4514..6ef1cc0 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -1,6 +1,9 @@ package controller; import view.*; + +import java.util.ArrayList; + import model.*; public class Cashflow @@ -8,8 +11,11 @@ public class Cashflow private GameBoard _board; - private Player[] _players; + public Player[] players; //private CardStack[] _cards; + public GameboardWindow gameboard; + public static int numPlayers; + public static void main(String[] args) { @@ -57,7 +63,7 @@ public class Cashflow public boolean isWinner() { boolean isWinner = false; - for(Player p : _players) + for(Player p : players) { if(p.hasWon()) { diff --git a/src/model/Player.java b/src/model/Player.java index 5d2fbcb..5afc969 100644 --- a/src/model/Player.java +++ b/src/model/Player.java @@ -6,7 +6,7 @@ public class Player private boolean _donate; private int _charityCount; //charity counter private int _downsizeCount; //down size counter - private int _location; + private int _location;//refers to a tile number private boolean _hasWon; public Player() diff --git a/src/view/GameboardWindow.java b/src/view/GameboardWindow.java index 29b0969..d6d8c45 100644 --- a/src/view/GameboardWindow.java +++ b/src/view/GameboardWindow.java @@ -1,27 +1,27 @@ package view; import model.*; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Image; - -import java.awt.Point; -import java.awt.geom.Path2D; +import controller.*; +import java.awt.*; import java.util.ArrayList; import javax.swing.ImageIcon; import javax.swing.JPanel; +import controller.Cashflow; + 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 GameBoard board; private Point[] points = new Point[24]; private ArrayList Positioners; + public GameboardWindow(GameBoard board) { this.board = board; Dimension size = new Dimension(img.getWidth(null), img.getHeight(null)); @@ -45,6 +45,7 @@ public class GameboardWindow extends JPanel { public void setUpTiles() { // 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 +// i guess it doesnt really matter what tile is which but the position matters - 0 is starting TileButton t1 = new TileButton("Deal", 0, board); this.add(t1); t1.setBounds(125,532,95,20); //xstart,ystart,width,height @@ -182,11 +183,10 @@ public class GameboardWindow extends JPanel { } - public void update(ArrayList 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(); - + public void update() { //updates the location of the player on the board + for (int i = 0; i < Cashflow.numPlayers; i++) { + int x = (int) points[Player[i].getLocation()].getX(); // i will fix this later + int y = (int) points[Player[i].getLocation()].getY(); // hopefully lol Positioners.get(i).setX(x); Positioners.get(i).setY(y); @@ -197,4 +197,5 @@ public class GameboardWindow extends JPanel { + }