public Player getRealPlayer() throws RealPlayerException {
Player playerFound = null;
for (Player p:players) {
if (p instanceof RealPlayer) {
if(playerFound != null) {
throw new RealPlayerException("there are several RealPlayers !");
}
else {
playerFound = p;
}
}
}
if (playerFound == null) {
throw new RealPlayerException("no RealPlayer found !");
}
return playerFound;
}