Updated 'Game' class.
Updated the 'Game' class by adding the 'host' attribute and its getter method to it.
This commit is contained in:
@@ -42,6 +42,9 @@ public class Game {
|
|||||||
// The die used in the game.
|
// The die used in the game.
|
||||||
private Die die;
|
private Die die;
|
||||||
|
|
||||||
|
// The host of this game
|
||||||
|
private int host;
|
||||||
|
|
||||||
// The color of the active player.
|
// The color of the active player.
|
||||||
private Color activeColor;
|
private Color activeColor;
|
||||||
|
|
||||||
@@ -232,6 +235,15 @@ public Color getActiveColor() {
|
|||||||
return activeColor;
|
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.
|
* This method sets the dice modifier.
|
||||||
*
|
*
|
||||||
@@ -304,6 +316,15 @@ public void setActiveColor(Color activeColor) {
|
|||||||
this.activeColor = 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.
|
* This method returns the all ready state.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user