Notes
This commit is contained in:
parent
043fdb36be
commit
a2e87345fb
|
|
@ -7,30 +7,29 @@ public class Game extends Thread {
|
|||
private AutoPlayer aiPlayer;
|
||||
private Board board;
|
||||
|
||||
private MyInterface mjf;
|
||||
private int COL_NUM = 8;
|
||||
private int LINE_NUM = 8;
|
||||
private int loopDelay = 250;
|
||||
boolean[] activationAIFlags;
|
||||
private MyInterface mjf; //Reference to GUI interface
|
||||
private int COL_NUM = 8; // number of columns of a chess board
|
||||
private int LINE_NUM = 8; // number of rows of a chess board
|
||||
private int loopDelay = 250; // Delay in milisec between turns (AI speed)
|
||||
boolean[] activationAIFlags; //Flags to enable or disable AI for white or black
|
||||
|
||||
//Constructor to initialize the game with a GUI interface
|
||||
public Game(MyInterface mjfParam) {
|
||||
mjf = mjfParam;
|
||||
board = new Board(COL_NUM, LINE_NUM);
|
||||
board = new Board(COL_NUM, LINE_NUM); // create a new chess board
|
||||
loopDelay = 250;
|
||||
LINE_NUM = 8;
|
||||
COL_NUM = 8;
|
||||
activationAIFlags = new boolean[2];
|
||||
aiPlayer = new AutoPlayer();
|
||||
activationAIFlags = new boolean[2]; // initialize AI flags: false by default
|
||||
aiPlayer = new AutoPlayer(); // create the AI player
|
||||
}
|
||||
|
||||
// getter for the board width
|
||||
public int getWidth() {
|
||||
return board.getWidth();
|
||||
}
|
||||
|
||||
//getter for the board height
|
||||
public int getHeight() {
|
||||
return board.getHeight();
|
||||
}
|
||||
|
||||
// Main loop for the game thread (run continuously)
|
||||
public void run() {
|
||||
while(true) {
|
||||
aiPlayerTurn();
|
||||
|
|
|
|||
Loading…
Reference in New Issue