summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r--src/jrummikub/model/GameSettings.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/jrummikub/model/GameSettings.java b/src/jrummikub/model/GameSettings.java
index 2a2b45d..7713e85 100644
--- a/src/jrummikub/model/GameSettings.java
+++ b/src/jrummikub/model/GameSettings.java
@@ -9,6 +9,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import jrummikub.model.PlayerSettings.Type;
+
/**
* The overall game settings
*/
@@ -229,4 +231,20 @@ public class GameSettings implements Serializable {
public void setNumberOfStonesDealt(int number) {
numberOfStonesDealt = number;
}
+
+ /**
+ * Check if there is only one human player
+ *
+ * @return one human player
+ */
+ public boolean oneHuman() {
+ int humans = 0;
+ for (PlayerSettings s : players) {
+ if (s.getType() == Type.HUMAN) {
+ humans++;
+ }
+ }
+ return (humans == 1);
+
+ }
}