Updated 'Game' class.
Updated the 'Game' class by setting the default value of 'host' attribute. In Addition, the 'isHost' method was added.
This commit is contained in:
@@ -43,7 +43,7 @@ public class Game {
|
||||
private Die die;
|
||||
|
||||
// The host of this game
|
||||
private int host;
|
||||
private int host = -1;
|
||||
|
||||
// The color of the active player.
|
||||
private Color activeColor;
|
||||
@@ -200,6 +200,15 @@ public Piece getPieceThroughUUID(UUID pieceId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be used to check if this client is the host for the game.
|
||||
*
|
||||
* @return true or false.
|
||||
*/
|
||||
public boolean isHost() {
|
||||
return this.host != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the dice modifier.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user