package othello; import java.awt.Point; import java.util.ArrayList; public class State { private int[][] board; private int player1; private int player2; private int currentPlayer; public State(int[][] board, int p1, int p2) { this.board = board; this.player1 = p1; this.player2 = p2; currentPlayer = p1; } public boolean isOver() { return false; } public ArrayList getMove(int player) { ArrayList moves = null; // Clonage // Parcours du plateau de jeu for (int i=0; i= 0) && (i+k < 7 ) && (j+l >= 0) && (j+l < 7 ) ) { System.out.println("jadd"); moves.add(new Point(i+k, j+l)); } } } } } } } // Saut return moves; } public int getScore(int player) { return 0; } public State play(int x, int y) { State copie = this.copie(); copie.board[x][y] = copie.getCurrentPlayer(); copie.switchPlayer(); return copie; } public int getCurrentPlayer() { return currentPlayer; } public void setCurrentPlayer(int currentPlayer) { this.currentPlayer = currentPlayer; } public State copie () { State copie = new State (this.board, this.player1, this.player2); for (int i=0; i