Package org.ggp.base.player.gamer

Examples of org.ggp.base.player.gamer.Gamer


*/
public class ClojureGamerTest extends Assert {
  @Test
    public void testClojureGamer() {
        try {
            Gamer g = new SampleClojureGamerStub();
            assertEquals("SampleClojureGamer", g.getName());

            Match m = new Match("", -1, 1000, 1000, GameRepository.getDefaultRepository().getGame("ticTacToe"));
            g.setMatch(m);
            g.setRoleName(GdlPool.getConstant("xplayer"));
            g.metaGame(1000);
            assertTrue(g.selectMove(1000) != null);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here


            GamerLogger.logError("Proxy", "Usage is: \n\tProxyGamePlayerClient gamer port");
            return;
        }

        int port = 9147;
        Gamer gamer = null;
        try {
            port = Integer.valueOf(args[1]);
        } catch(Exception e) {
            GamerLogger.logError("Proxy", args[1]+" is not a valid port.");
            return;
View Full Code Here

      }
      if (chosenGamerClass == null) {
        System.out.println("Could not find player class with that name. Available choices are: " + Arrays.toString(availableGamers.toArray()));
        return;
      }
      Gamer gamer = (Gamer) chosenGamerClass.newInstance();
    new GamePlayer(port, gamer).start();
  }
View Full Code Here

    });

    List<Class<? extends Gamer>> gamersCopy = new ArrayList<Class<? extends Gamer>>(gamers);
    for(Class<? extends Gamer> gamer : gamersCopy)
    {
      Gamer g;
      try {
        g = gamer.newInstance();
        typeComboBox.addItem(g.getName());
      } catch(Exception ex) {
          gamers.remove(gamer);
      }
    }
    typeComboBox.setSelectedItem("Random");
View Full Code Here

          MatchPanel matchPanel = new MatchPanel();
          NetworkPanel networkPanel = new NetworkPanel();
          DetailPanel detailPanel = null;
          ConfigPanel configPanel = null;
          Gamer gamer = null;

          Class<?> gamerClass = gamers.get(typeComboBox.getSelectedIndex());
          try {
            gamer = (Gamer) gamerClass.newInstance();
          } catch(Exception ex) { throw new RuntimeException(ex); }
          detailPanel = gamer.getDetailPanel();
          configPanel = gamer.getConfigPanel();

          gamer.addObserver(matchPanel);
          gamer.addObserver(detailPanel);

          GamePlayer player = new GamePlayer(port, gamer);
          player.addObserver(networkPanel);
          player.start();
View Full Code Here

        gamers = Lists.newArrayList(ProjectSearcher.GAMERS.getConcreteClasses());
        List<Class<?>> gamersCopy = new ArrayList<Class<?>>(gamers);
        for(Class<?> gamer : gamersCopy)
        {
            try {
                Gamer g = (Gamer) gamer.newInstance();
                if (!g.isComputerPlayer()) {
                  throw new Exception("Kiosk only considers computer players");
                }
                playerComboBox.addItem(g.getName());
            } catch(Exception ex) {
                gamers.remove(gamer);
            }
        }
        playerComboBox.setSelectedItem("Random");
View Full Code Here

                    theComputerPlayer = null;
                }

                // Start a new player if necessary
                if(theComputerPlayer == null) {
                    Gamer gamer = null;
                    if(!playerComboBox.getSelectedItem().equals(remotePlayerString)) {
                        Class<?> gamerClass = gamers.get(playerComboBox.getSelectedIndex());
                        try {
                            gamer = (Gamer) gamerClass.newInstance();
                        } catch(Exception ex) { throw new RuntimeException(ex); }
View Full Code Here

*/
public class PythonGamerTest extends Assert {
  @Test
    public void testPythonGamer() {
        try {
            Gamer g = new SamplePythonGamerStub();
            assertEquals("SamplePythonGamer", g.getName());

            Match m = new Match("", -1, 1000, 1000, GameRepository.getDefaultRepository().getGame("ticTacToe"));
            g.setMatch(m);
            g.setRoleName(GdlPool.getConstant("xplayer"));
            g.metaGame(1000);
            assertTrue(g.selectMove(1000) != null);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of org.ggp.base.player.gamer.Gamer

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.