- Reorganized packages so that the computer agents are inside the model package.
- Added support for the player model inside Referee.java; high scores should now persist over a single execution of the program. - Refactored PlayerModel.java to support game logging. All games are now logged so that we can track overall progress. - Added scaffolding to allow saving and importing of PlayerModel.java. It is not yet functional, but it will be with two function implementations and then the appropriate calls.
This commit is contained in:
25
src/model/comPlayer/MinimaxComPlayer.java
Normal file
25
src/model/comPlayer/MinimaxComPlayer.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package model.comPlayer;
|
||||
|
||||
import model.Board;
|
||||
import model.Move;
|
||||
import model.comPlayer.generator.MinimaxMoveGenerator;
|
||||
import model.comPlayer.generator.MoveGenerator;
|
||||
|
||||
public class MinimaxComPlayer implements Player{
|
||||
private MoveGenerator moveGenerator = new MinimaxMoveGenerator();
|
||||
|
||||
@Override
|
||||
public Move getMove(Board board) {
|
||||
return moveGenerator.genMove(board, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void denyMove() {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return true; // always ready to play a random valid move
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user