From 4860867fe8bf45432cd9b7967bc34398af8d013f Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Fri, 17 Jun 2011 22:24:23 +0200 Subject: halbfertige netzwerkdinge git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@450 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/GameSettings.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/jrummikub/model') 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); + + } } -- cgit v1.2.3