Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
asdf
  • Loading branch information
Joe Hill committed Apr 23, 2017
1 parent 7e4dc47 commit 32004f1
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 36 deletions.
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
Binary file modified bin/model/GameBoard.class
Binary file not shown.
Binary file modified bin/model/Tile.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.
81 changes: 46 additions & 35 deletions src/controller/Cashflow.java
Expand Up @@ -3,23 +3,25 @@ package controller;
import view.*; import view.*;


import java.util.ArrayList; import java.util.ArrayList;
import java.awt.*;
import java.swing.*;


import javax.swing.*;

import java.awt.*;
import model.*; import model.*;


public class Cashflow public class Cashflow
{ {
private static GameBoard _board; private static GameBoard _board;
public GameboardWindow gameboard; public GameboardWindow gameboard;
public static ArrayList<Player> _players;
public static int numPlayers; public static int numPlayers;
private JFrame frame; private JFrame frame;
private JWindow sidewindow; private JWindow sidewindow;
private GameboardWindow window; private GameboardWindow window;


public static void main(String[] args) public static void main(String[] args)
{ {
go(); testGamePlay();
} }


public static void go() public static void go()
Expand All @@ -28,16 +30,16 @@ public class Cashflow
// Initialize players (pick professions) // Initialize players (pick professions)
MainMenu mm = new MainMenu(); MainMenu mm = new MainMenu();
String[] names = mm.makeMainMenu(); String[] names = mm.makeMainMenu();
ArrayList<Player> players = new ArrayList<Player>(); _players = new ArrayList<Player>();
for(String name : names) for(String name : names)
{ {
players.add(new Player(name)); _players.add(new Player(name));
} }


// Initialize game board // Initialize game board
_board = new GameBoard(players); _board = new GameBoard(_players);



System.out.println("hello");
// Initialize GUI // Initialize GUI




Expand Down Expand Up @@ -85,9 +87,13 @@ public class Cashflow


private static void testGamePlay() private static void testGamePlay()
{ {
Player p1 = new Player();
Player p2 = new Player(); Player p1 = new Player("1");
GameBoard g = new GameBoard(p1, p2); Player p2 = new Player("2");
ArrayList<Player> players = new ArrayList<Player>();
players.add(p1);
players.add(p2);
GameBoard g = new GameBoard(players);
System.out.println(p1.getLocation()); System.out.println(p1.getLocation());
g.movePlayer(p1, 5); g.movePlayer(p1, 5);
System.out.println(p1.getLocation()); System.out.println(p1.getLocation());
Expand Down Expand Up @@ -137,31 +143,36 @@ public class Cashflow




} }
public void setUpScreen() {
frame = new JFrame("Cashflow");
frame.setLayout(new FlowLayout()); //
window = new GameboardWindow(_board); // public void setUpScreen()

// {
sidewindow = new JWindow(); // frame = new JFrame("Cashflow");
sidewindow.setLayout(new GridLayout(5, 5)); // frame.setLayout(new FlowLayout());

// window = new GameboardWindow(_board);
frame.add(window); //

// sidewindow = new JWindow();

// sidewindow.setLayout(new GridLayout(5, 5));
frame.pack(); //

// frame.add(window);
frame.setVisible(true); //
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //
} // frame.pack();
public static void main(String[] args) { //
new Cashflow(4); // frame.setVisible(true);

// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} // }
public Cashflow(int numPlayers) // public static void main(String[] args) {
{ // new Cashflow(4);
//this.setUpScreen(); // just did this to test the screen //

// }
} // public Cashflow(int numPlayers)
// {
// //this.setUpScreen(); // just did this to test the screen
//
// }



} }


Expand Down
2 changes: 1 addition & 1 deletion src/model/GameBoard.java
Expand Up @@ -73,7 +73,7 @@ public class GameBoard


currentNode = nextNode; currentNode = nextNode;
} }
currentNode.getData().addPlayers(p); currentNode.getData().addPlayer(p);
p.setLocation(currentNode.getData().getBoardIndex()); p.setLocation(currentNode.getData().getBoardIndex());
currentNode.getData().getLandedOn(p); currentNode.getData().getLandedOn(p);
return passedPaydays; return passedPaydays;
Expand Down
5 changes: 5 additions & 0 deletions src/model/Tile.java
Expand Up @@ -39,5 +39,10 @@ public class Tile
{ {
_players.remove(p); _players.remove(p);
} }

public void addPlayer(Player p)
{
_players.add(p);
}


} }

0 comments on commit 32004f1

Please sign in to comment.