diff options
author | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-17 22:24:23 +0200 |
---|---|---|
committer | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-17 22:24:23 +0200 |
commit | 4860867fe8bf45432cd9b7967bc34398af8d013f (patch) | |
tree | ebd5473ff5c700fdac5fe461bc264d33ed4abdce /src/jrummikub/model | |
parent | 5a4d1ccb12d697d6cd0a0ea187045c9f6370814c (diff) | |
download | JRummikub-4860867fe8bf45432cd9b7967bc34398af8d013f.tar JRummikub-4860867fe8bf45432cd9b7967bc34398af8d013f.zip |
halbfertige netzwerkdinge
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@450 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r-- | src/jrummikub/model/GameSettings.java | 18 |
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); + + } } |