Skip to content
Snippets Groups Projects
Commit 6d938aa0 authored by JimmyTheCat's avatar JimmyTheCat
Browse files

2nd Board constructor

parent 42000598
No related branches found
No related tags found
No related merge requests found
......@@ -27,12 +27,19 @@ public class Board extends Thread {
* Creates the Tiles and Players and sets the player who starts the game.
*/
Board() {
for(int i = 0; i < tiles.length; i++) tiles[i] = new Tile(0,0,0);
for(int i = 0; i < tiles.length; i++) tiles[i] = new Tile(this,0,0,0);
for(int i = 0; i < players.length; i++) players[i] = new Player(i+1);
currentPlayer = 0;
marks = 0;
}
Board(Player[] players) {
for(int i = 0; i < tiles.length; i++) tiles[i] = new Tile(this,0,0,0);
this.players = players;
currentPlayer = 0;
marks = 0;
}
/**Ends the turn by increasing the mark counter and changing the player.
* Additionally it ends the game when certain conditions are met.
*/
......
......@@ -3,7 +3,6 @@ public class Main {
public static void main(String[] args) {
GameUI gui = new GameUI();
gui.call(args);
Board board = new Board();
//System.out.println("hi");
}
......
......@@ -5,7 +5,7 @@ public class Player {
public Player(int playerNumber) {
this.playerNumber = playerNumber;
playerScore = 0;
this.playerScore = 0;
}
public int getPlayerNumber() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment