- Made the getBoardState method in Referee.java static. - Created NeuralNetworkPlayer.java, though I don't know how to make the computer use it. - Updated the Player interface to include passing the PlayerModel. Most of the current com agents ignore the data, but it is now available. - Updated the train function in PlayerModel.java.
37 lines
672 B
Java
37 lines
672 B
Java
package model;
|
|
|
|
import model.Board.TileColor;
|
|
|
|
public class Move {
|
|
/**
|
|
* Used when genMove() is called but no valid move exists for that player.
|
|
*/
|
|
public static final Move NONE = new Move(TileColor.NONE, -1, -1);
|
|
|
|
private final TileColor color;
|
|
private final CellPointer cp;
|
|
|
|
public Move(TileColor tlClr, CellPointer cllPntr) {
|
|
cp = cllPntr;
|
|
color = tlClr;
|
|
}
|
|
|
|
public Move(TileColor color, int row, int column) {
|
|
cp = new CellPointer(row, column);
|
|
this.color = color;
|
|
}
|
|
|
|
public CellPointer getCell() {
|
|
return cp;
|
|
}
|
|
|
|
public TileColor getColor() {
|
|
return color;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Play " + color + "@" + cp;
|
|
}
|
|
}
|