@@ -0,0 +1,1609 @@
+package org.ggp.base.apps.validator;%0A%0Aimport org.ggp.base.util.game.CloudGameRepository;%0Aimport org.ggp.base.util.game.Game;%0Aimport org.ggp.base.util.game.GameRepository;%0Aimport org.ggp.base.validator.BasesInputsValidator;%0Aimport org.ggp.base.validator.SimulationValidator;%0Aimport org.ggp.base.validator.StaticValidator;%0Aimport org.ggp.base.validator.GameValidator;%0Aimport org.ggp.base.validator.ValidatorException;%0A%0A/**%0A * BatchValidator does game validation on all of the games in a given game repository.%0A * This allows you to quickly determine which games need to be repaired, given a large%0A * existing game repository with games of varying quality.%0A * %0A * @author schreib%0A */%0Apublic final class BatchValidator%0A%7B%0A%09public static void main(String%5B%5D args)%0A%09%7B%0A%09%09GameRepository repo = new CloudGameRepository(%22games.ggp.org/base%22);%09%09%0A%09%09for (String gameKey : repo.getGameKeys()) %7B%0A%09%09%09if (gameKey.contains(%22amazons%22) %7C%7C gameKey.contains(%22quad%22) %7C%7C gameKey.contains(%22blokbox%22) %7C%7C gameKey.contains(%22othello%22))%0A%09%09%09%09continue;%0A%09%09%09Game game = repo.getGame(gameKey);%0A%09%09%09GameValidator%5B%5D theValidators = new GameValidator%5B%5D %7B%0A%09%09%09%09%09new StaticValidator(),%0A%09%09%09%09%09new BasesInputsValidator(3000),%0A%09%09%09%09%09new SimulationValidator(300, 10)%0A%09%09%09%7D;%0A%09%09%09System.out.print(gameKey + %22 ... %22);%0A%09%09%09System.out.flush();%0A%09%09%09boolean isValid = true;%0A%09%09%09for (GameValidator theValidator : theValidators) %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09theValidator.checkValidity(game);%0A%09%09%09%09%7D catch (ValidatorException ve) %7B%0A%09%09%09%09%09System.out.println(%22Failed: %22 + ve);%0A%09%09%09%09%09isValid = false;%0A%09%09%09%09%09break;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09if (isValid) %7B%0A%09%09%09%09System.out.println(%22Passed!%22);%0A%09%09%09%7D%0A%09%09%7D%09%09%0A%09%7D%0A%7D

Add a batch game validator, for cleaning up game repositories.