Package cero.games

Examples of cero.games.ValidationException


    return null;
  }

  public void validateGame(Game game) throws ValidationException {
    if (game.getPlayers().size() < 1)
      throw new ValidationException(
          "You can't play a game with no player !");
    // I suppose there are no games we can't be used in, apart from stupid
    // cases like this one
  }
View Full Code Here


    for (Rule rule : ruleCollector) {
      rule.validateGame(this);
    }

    if (rounds.size() <= 0)
      throw new ValidationException(
          "The game needs to have rounds to be run");
  }
View Full Code Here

      cardNumber += zone.getCardCount();
    for (cero.games.Player player : game.getPlayers())
      for (Zone zone : player.getZones())
        cardNumber += zone.getCardCount();
    if (cardNumber <= game.getPlayers().size() * cardDealtNumber)
      throw new ValidationException("There must be enough cards to deal");
  }
View Full Code Here

    return "2 players min";
  }

  public void validateGame(Game game) throws ValidationException {
    if (game.getPlayers().size() <= 2)
      throw new ValidationException("There must be at least 2 players");
  }
View Full Code Here

TOP

Related Classes of cero.games.ValidationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.