Files
gomoku/src/Player.java
Aubin DORIVAL 7efba643b5 docs
2025-03-31 12:01:51 +02:00

55 lines
1.2 KiB
Java

abstract class Player{
/**
* This class is an abstract class to choose between player and Gomoku AI.
*/
/** The name of the Player */
private String name;
/** The color of the Player */
protected Color color;
//------------------Constructors--------------------------
/**
* The constructor of the Player.
* @param name The name of the player.
* @param color The color of the player.
*/
public void Player(String name,Color color){
this.name = name;
this.color = color;
}
//------------------Gets--------------------------
/**
* Return the name of the player.
* @return The name of the player.
*/
public String getName() {
return this.name;
}
/**
* Return the color of the player.
* @return The color of the player.
*/
public Color getColor() {
return this.color;
}
//------------------Methods--------------------------
/**
* Return the coordinate of the move played by the player.
* @param board The actual Gomoku board.
* @return The cell of the move played.
*/
public abstract GomokuCell chooseMove(GomokuBoard board);
}