diff --git a/bin/controller/Cashflow.class b/bin/controller/Cashflow.class index 13f0cc3..e57c612 100644 Binary files a/bin/controller/Cashflow.class and b/bin/controller/Cashflow.class differ diff --git a/bin/model/DoodadTile.class b/bin/model/DoodadTile.class index 7e73a9e..d47f229 100644 Binary files a/bin/model/DoodadTile.class and b/bin/model/DoodadTile.class differ diff --git a/bin/model/DownsizeTile.class b/bin/model/DownsizeTile.class index 058fe38..e6ada5c 100644 Binary files a/bin/model/DownsizeTile.class and b/bin/model/DownsizeTile.class differ diff --git a/bin/model/FinancialStatement.class b/bin/model/FinancialStatement.class index 14738b8..dfb60c0 100644 Binary files a/bin/model/FinancialStatement.class and b/bin/model/FinancialStatement.class differ diff --git a/bin/model/GameBoard.class b/bin/model/GameBoard.class index d75668d..41e8300 100644 Binary files a/bin/model/GameBoard.class and b/bin/model/GameBoard.class differ diff --git a/bin/model/Tile.class b/bin/model/Tile.class index 6f236de..521077c 100644 Binary files a/bin/model/Tile.class and b/bin/model/Tile.class differ diff --git a/bin/model/TileCircularLinkedList.class b/bin/model/TileCircularLinkedList.class index 2577118..1d7bd34 100644 Binary files a/bin/model/TileCircularLinkedList.class and b/bin/model/TileCircularLinkedList.class differ diff --git a/bin/view/CharityWindow$2.class b/bin/view/CharityWindow$2.class index 2dee356..bbc9c4f 100644 Binary files a/bin/view/CharityWindow$2.class and b/bin/view/CharityWindow$2.class differ diff --git a/bin/view/DoodadCardWindow$1.class b/bin/view/DoodadCardWindow$1.class index 63ad1b1..2dba6e0 100644 Binary files a/bin/view/DoodadCardWindow$1.class and b/bin/view/DoodadCardWindow$1.class differ diff --git a/bin/view/DoodadCardWindow$2.class b/bin/view/DoodadCardWindow$2.class deleted file mode 100644 index da8c80f..0000000 Binary files a/bin/view/DoodadCardWindow$2.class and /dev/null differ diff --git a/bin/view/DoodadCardWindow.class b/bin/view/DoodadCardWindow.class index 65ca86f..7f68037 100644 Binary files a/bin/view/DoodadCardWindow.class and b/bin/view/DoodadCardWindow.class differ diff --git a/bin/view/DownSizeWindow.class b/bin/view/DownSizeWindow.class index 506d0a8..2f1231e 100644 Binary files a/bin/view/DownSizeWindow.class and b/bin/view/DownSizeWindow.class differ diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index 867a104..fde4514 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -69,9 +69,12 @@ public class Cashflow private static void testGamePlay() { - Player p = new Player(); - System.out.println(p.getFinancialStatement().getProfession().getName()); - GameBoard g = new GameBoard(); + Player p1 = new Player(); + Player p2 = new Player(); + GameBoard g = new GameBoard(p1, p2); + System.out.println(p1.getLocation()); + g.movePlayer(p1, 5); + System.out.println(p1.getLocation()); } diff --git a/src/model/DoodadTile.java b/src/model/DoodadTile.java index 97bc6b5..f0bee71 100644 --- a/src/model/DoodadTile.java +++ b/src/model/DoodadTile.java @@ -1,5 +1,7 @@ package model; +import view.*; + public class DoodadTile extends Tile { private static DoodadStack _doodadStack; @@ -15,6 +17,10 @@ public class DoodadTile extends Tile { FinancialStatement f = p.getFinancialStatement(); DoodadCard dc = _doodadStack.pickCard(); + + DoodadCardWindow DoodadCardWindow = new DoodadCardWindow(); + DoodadCardWindow.showButtonDemo(); + int amount = dc.getValue(); if (f.getCashBalance() > amount) { diff --git a/src/model/DownsizeTile.java b/src/model/DownsizeTile.java index 87a49e8..96f4dc3 100644 --- a/src/model/DownsizeTile.java +++ b/src/model/DownsizeTile.java @@ -1,5 +1,7 @@ package model; +import view.DownSizeWindow; + public class DownsizeTile extends Tile{ public DownsizeTile(String type, int boardIndex) { @@ -10,5 +12,11 @@ public class DownsizeTile extends Tile{ public void getLandedOn(Player p) { p.increaseDownsizeCount(); + + DownSizeWindow DownSizeWindow = new DownSizeWindow(); + DownSizeWindow.showButtonDemo(); + + // TODO + System.out.println("Player landed on downsized"); } } diff --git a/src/model/FinancialStatement.java b/src/model/FinancialStatement.java index b09e122..d0f805e 100644 --- a/src/model/FinancialStatement.java +++ b/src/model/FinancialStatement.java @@ -205,28 +205,7 @@ public class FinancialStatement return _totalIncome; } - public int getSalary() - { - return _salary; - } - - public int getSalary() - { - return _salary; - } - - public int getSalary() - { - return _salary; - } - public int getSalary() - { - return _salary; - } - public int getSalary() - { - return _salary; - } + } diff --git a/src/model/GameBoard.java b/src/model/GameBoard.java index fcb451c..91f967d 100644 --- a/src/model/GameBoard.java +++ b/src/model/GameBoard.java @@ -41,16 +41,13 @@ public class GameBoard { _profs = new Professions(); _tiles = new TileCircularLinkedList(); - _tiles.addTiles(t1, t2, t3, t4); + _tiles.addTiles(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24); t1.addPlayers(players); } - public Tile getTile(int num) { - ArrayList tileList = new ArrayList(); - Tile[] tileList1 = { - t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24 - }; - tileList.addAll(Arrays.asList(tileList1)); - return tileList.get(num); + + + public Tile getTile(int index) { + return _tiles.get(index).getData(); } // TODO This method will move the player and returns the number of pay days they passed along the way. @@ -70,6 +67,10 @@ public class GameBoard { passedPaydays++; } + + // TODO update player location on board each iteration and maybe add delay + System.out.println("Player is at tile number: " + currentNode.getData().getBoardIndex()); + currentNode = nextNode; } currentNode.getData().addPlayers(p); diff --git a/src/model/Stock.java b/src/model/Stock.java index d224b57..c821ab1 100644 --- a/src/model/Stock.java +++ b/src/model/Stock.java @@ -35,4 +35,5 @@ public class Stock return _numShares; } + } \ No newline at end of file diff --git a/src/model/Tile.java b/src/model/Tile.java index 3342262..dac1f40 100644 --- a/src/model/Tile.java +++ b/src/model/Tile.java @@ -10,6 +10,7 @@ public class Tile public Tile(String name, int boardIndex) { + _players = new ArrayList(); _name = name; _boardIndex = boardIndex; } diff --git a/src/model/TileCircularLinkedList.java b/src/model/TileCircularLinkedList.java index 927eabc..b7834cb 100644 --- a/src/model/TileCircularLinkedList.java +++ b/src/model/TileCircularLinkedList.java @@ -64,7 +64,7 @@ public class TileCircularLinkedList return null; } Node n = head; - while(index-1!=0){ + while(index!=0){ n=n.next; index--; } @@ -76,7 +76,7 @@ public class TileCircularLinkedList return null; } Node n = head; - while(index-1!=0){ + while(index!=0){ n=n.next; index--; } diff --git a/src/view/CharityWindow.java b/src/view/CharityWindow.java index 99f61e2..dc5f5e5 100644 --- a/src/view/CharityWindow.java +++ b/src/view/CharityWindow.java @@ -61,7 +61,7 @@ public class CharityWindow { public void actionPerformed(ActionEvent e) { //put message that they donated xx dollars after 10 seconds, close window try { - Thread.sleep(1000); + Thread.sleep(1); } catch (InterruptedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -77,7 +77,7 @@ public class CharityWindow { DontDonate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //put message that they are greedy. after 10 seconds, close window - System.exit(0); + System.exit(0); } }); controlPanel.add(Donate); diff --git a/src/view/DoodadCardWindow.java b/src/view/DoodadCardWindow.java index 8a34247..d93e80d 100644 --- a/src/view/DoodadCardWindow.java +++ b/src/view/DoodadCardWindow.java @@ -29,7 +29,7 @@ public class DoodadCardWindow { DoodadCardWindow DoodadCardWindow = new DoodadCardWindow(); DoodadCardWindow.showButtonDemo(); } - private void prepareGUI(){ + private void prepareGUI(DoodadCard dc){ mainFrame = new JFrame("Doodad"); mainFrame.getContentPane().setBackground(new Color(250, 51, 51)); mainFrame.setSize(350,250); @@ -56,7 +56,7 @@ public class DoodadCardWindow { mainFrame.setVisible(true); } - private void showButtonDemo(){ + public void showButtonDemo(){ headerLabel.setText("Call Doodad Title here"); statusLabel.setText("Call Doodad Description here"); //resources folder should be inside SWING folder. diff --git a/src/view/DownSizeWindow.java b/src/view/DownSizeWindow.java index f032ed6..8f9265a 100644 --- a/src/view/DownSizeWindow.java +++ b/src/view/DownSizeWindow.java @@ -54,7 +54,7 @@ public class DownSizeWindow { mainFrame.setVisible(true); } - private void showButtonDemo(){ + public void showButtonDemo(){ headerLabel.setText("Downsize"); statusLabel.setText("You lose 3 turns."); //resources folder should be inside SWING folder.