Exemple #1
0
 //    public boolean replayTable(UUID userId) {
 //        if (table.getState() != TableState.FINISHED) {
 //            return false;
 //        }
 //        ReplayManager.getInstance().replayGame(table.getId(), userId);
 //        return true;
 //    }
 private Player createPlayer(String name, String playerType, int skill) {
   Player player;
   if (options == null) {
     player =
         PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, skill);
   } else {
     player =
         PlayerFactory.getInstance().createPlayer(playerType, name, options.getRange(), skill);
   }
   if (player != null) {
     logger.trace("Player " + player.getName() + " created id: " + player.getId());
   }
   return player;
 }
Exemple #2
0
 @BeforeClass
 public static void init() {
   Logger.getRootLogger().setLevel(Level.DEBUG);
   logger.info("Starting MAGE tests");
   logger.info("Logging level: " + logger.getLevel());
   deleteSavedGames();
   ConfigSettings config = ConfigSettings.getInstance();
   for (GamePlugin plugin : config.getGameTypes()) {
     GameFactory.getInstance()
         .addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin));
   }
   for (GamePlugin plugin : config.getTournamentTypes()) {
     TournamentFactory.getInstance()
         .addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin));
   }
   for (Plugin plugin : config.getPlayerTypes()) {
     PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin));
   }
   //        for (Plugin plugin : config.getDeckTypes()) {
   //            DeckValidatorFactory.getInstance().addDeckType(plugin.getName(),
   // loadPlugin(plugin));
   //        }
   Copier.setLoader(classLoader);
 }
Exemple #3
0
 protected Player createPlayer(String name, String playerType) {
   return PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, 5);
 }