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 java.util.ArrayList;
import java.awt.*;
import java.swing.*;

import javax.swing.*;

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

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

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

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

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


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


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

private static void testGamePlay()
{
Player p1 = new Player();
Player p2 = new Player();
GameBoard g = new GameBoard(p1, p2);

Player p1 = new Player("1");
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());
g.movePlayer(p1, 5);
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);

sidewindow = new JWindow();
sidewindow.setLayout(new GridLayout(5, 5));

frame.add(window);


frame.pack();

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

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

}


//
// public void setUpScreen()
// {
// frame = new JFrame("Cashflow");
// frame.setLayout(new FlowLayout());
// window = new GameboardWindow(_board);
//
// sidewindow = new JWindow();
// sidewindow.setLayout(new GridLayout(5, 5));
//
// frame.add(window);
//
//
// frame.pack();
//
// frame.setVisible(true);
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// }
// public static void main(String[] args) {
// new Cashflow(4);
//
// }
// 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.getData().addPlayers(p);
currentNode.getData().addPlayer(p);
p.setLocation(currentNode.getData().getBoardIndex());
currentNode.getData().getLandedOn(p);
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);
}

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

}

0 comments on commit 32004f1

Please sign in to comment.