@Override public final GdlSentence selectMove(long timeout) throws MoveSelectionException { theClojureGamer.setMatch(getMatch()); theClojureGamer.setRoleName(getRoleName()); try { return theClojureGamer.selectMove(timeout); } catch (RuntimeException e) { GamerLogger.logError("GamePlayer", "Caught exception in Clojure stateMachineSelectMove:"); GamerLogger.logStackTrace("GamePlayer", e); return null; } }
// TODO: This code should be put somewhere more general. public static void main(String args[]) { try { Gamer g = new ClojureLegalGamerStub(); System.out.println(g.getName()); Match m = new Match("", 1000, 1000, GameRepository.getDefaultRepository().getGame("conn4")); g.setMatch(m); g.setRoleName(GdlPool.getProposition(GdlPool.getConstant("xplayer"))); g.metaGame(1000); System.out.println(g.selectMove(1000)); } catch (Exception e) { e.printStackTrace(); } }