Updated 'Game' class.

Updated the 'Game' class by adding the 'host' attribute and its getter method to it.
This commit is contained in:
Daniel Grigencha
2024-12-02 00:19:46 +01:00
parent ea6431faa4
commit dee6bf9f9c

View File

@@ -42,6 +42,9 @@ public class Game {
// The die used in the game.
private Die die;
// The host of this game
private int host;
// The color of the active player.
private Color activeColor;
@@ -232,6 +235,15 @@ public Color getActiveColor() {
return activeColor;
}
/**
* This method will be used to return host attribute of Game class.
*
* @return host as an Integer.
*/
public int getHost() {
return this.host;
}
/**
* This method sets the dice modifier.
*
@@ -304,6 +316,15 @@ public void setActiveColor(Color activeColor) {
this.activeColor = activeColor;
}
/**
* This method will be used to set host attribute of Game class to the given host parameter.
*
* @param host as the new value of host as an Integer.
*/
public void setHost(int host) {
this.host = host;
}
/**
* This method returns the all ready state.
*