add Doc
This commit is contained in:
@@ -3,9 +3,21 @@ import java.util.Random;
|
|||||||
|
|
||||||
public class GomokuAI{
|
public class GomokuAI{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is an extends of the class Player, this allows the GomokuAI to choose his move.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** The random initialization */
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
|
/** The difficulty of the GomokuAI */
|
||||||
int difficulty = 0;
|
int difficulty = 0;
|
||||||
|
|
||||||
|
//------------------Methods--------------------------
|
||||||
|
/**
|
||||||
|
* Return the coordinate of the move played by the Gomoku AI.
|
||||||
|
* @param Board The actual Gomoku board.
|
||||||
|
* @return The coordinate of the move played.
|
||||||
|
*/
|
||||||
public Coordinate chooseMove(GomokuBoard board){
|
public Coordinate chooseMove(GomokuBoard board){
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,18 @@
|
|||||||
import java.io.Console;
|
import java.io.Console;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Human{
|
public class Human extends Player{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is an extends of the class Player, this allows the player to choose his move.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//------------------Methods--------------------------
|
||||||
|
/**
|
||||||
|
* Return the coordinate of the move played by the player.
|
||||||
|
* @param Board The actual Gomoku board.
|
||||||
|
* @return The coordinate of the move played.
|
||||||
|
*/
|
||||||
public Coordinate chooseMove(GomokuBoard board){
|
public Coordinate chooseMove(GomokuBoard board){
|
||||||
|
|
||||||
Console cons = System.console();
|
Console cons = System.console();
|
||||||
|
|||||||
@@ -1,14 +1,42 @@
|
|||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
abstract class Player{
|
abstract class Player{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is an abstract class to choose between player and Gomoku AI.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** The name of the Player */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
//------------------Constructors--------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The constructor of the Player.
|
||||||
|
* @param name The name of the player.
|
||||||
|
*/
|
||||||
|
public void Player(String name){
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------Gets--------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the name of the player.
|
||||||
|
* @return The name of the player.
|
||||||
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract Coordinate chooseMove(GomokuBoard Board);
|
//------------------Methods--------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the coordinate of the move played by the player.
|
||||||
|
* @param Board The actual Gomoku board.
|
||||||
|
* @return The coordinate of the move played.
|
||||||
|
*/
|
||||||
|
public abstract Coordinate chooseMove(GomokuBoard board);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user