halbfertige netzwerkdinge
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@450 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
5a4d1ccb12
commit
4860867fe8
4 changed files with 94 additions and 25 deletions
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue