From dee6bf9f9c2f7aaaa2542eb7a4897deb1052f0ba Mon Sep 17 00:00:00 2001 From: Daniel Grigencha Date: Mon, 2 Dec 2024 00:19:46 +0100 Subject: [PATCH] Updated 'Game' class. Updated the 'Game' class by adding the 'host' attribute and its getter method to it. --- .../src/main/java/pp/mdga/game/Game.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java index 0ea882ba..ac97b92e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java @@ -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. *