Updated 'Game' class.
Updated the 'Game' class by adding the 'getActivePlayerId' method to it.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user