Updated 'Game' class.

Updated the 'Game' class by adding the 'getActivePlayerId' method to it.
This commit is contained in:
Daniel Grigencha
2024-12-03 03:40:24 +01:00
parent 3353a890d3
commit 79bf1c16e8

View File

@@ -152,6 +152,16 @@ public Player getPlayerByColor(Color color) {
return null;
}
/**
* This method will be used to return the id of the active player depending on the activeColor attribute of Game
* class.
*
* @return the id of the active player as an Integer.
*/
public int getActivePlayerId() {
return this.getPlayerIdByColor(this.activeColor);
}
/**
* This method will be used to return the id of the Player defined by the given color parameter.
*