Files
gomoku/src/Player.java
2025-04-07 10:00:50 +02:00

58 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;
int tokens;
//------------------Constructors--------------------------
/**
* The constructor of the Player.
* @param name The name of the player.
* @param color The color of the player.
*/
public Player(String name,Color color, int tokens){
this.name = name;
this.color = color;
this.tokens= tokens;
}
//------------------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);
}