Examples of Game


Examples of net.drthum.simon.model.Game

    private void miQuitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miQuitActionPerformed
        System.exit(0);
    }//GEN-LAST:event_miQuitActionPerformed

    private void miNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miNewActionPerformed
        game = new Game();
        game.addPropertyChangeListener(new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent pce) {
                if (pce.getPropertyName().equals(Game.GAMESEQ_CHANGED))
                    playSequence(game.getGameSequence());
View Full Code Here

Examples of net.sertik.genesia.entity.Game

    startNewGame.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    startNewGame.setCursor(Cursor.HAND);
    startNewGame.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent ae) {
        Game game = new Game();
        game.setDifficulty((Game.Difficulty) gameLevel.getSelectedToggle().getUserData());

        int totalPlayers = (Integer) numberOfPlayers.getSelectedToggle().getUserData();
        for (int i = 0; i < totalPlayers; i++) {
          Player player = new Player();
          player.setComputer(false);
          player.setColor(Player.COLORS[i]);
          switch (game.getDifficulty()) {
            case BEGINNER:
              player.setGold(12000);
            case NORMAL:
              player.setGold(10000);
            case ADVANCED:
              player.setGold(8000);
          }
          game.getPlayers().add(player);
        }
        for (int i = totalPlayers; i < 3; i++) {
          Player player = new Player();
          player.setComputer(true);
          player.setColor(Player.COLORS[i]);
          player.setName(Player.NAMES[i - totalPlayers]);
          switch (game.getDifficulty()) {
            case BEGINNER:
              player.setGold(8000);
            case NORMAL:
              player.setGold(10000);
            case ADVANCED:
              player.setGold(12000);
          }
          game.getPlayers().add(player);
        }

        WorldGenerator worldGenerator = (WorldGenerator) worldCreation.getSelectedToggle().getUserData();
        game.setWorld(worldGenerator.generate(64, 256));

        genesia.setGame(game);
      }
    });
View Full Code Here

Examples of net.socialgamer.cah.data.Game

      gameId = Integer.parseInt(request.getParameter(AjaxRequest.GAME_ID));
    } catch (final NumberFormatException nfe) {
      return error(ErrorCode.INVALID_GAME);
    }

    final Game game = gameManager.getGame(gameId);
    if (game == null) {
      return error(ErrorCode.INVALID_GAME);
    }

    assert game.getId() == gameId : "Got a game with id not what we asked for.";

    return handle(request, session, user, game);
  }
View Full Code Here

Examples of net.yura.lobby.model.Game

        ((Integer)numberDecks.getValue()).intValue(),
        ((Integer)easybotsplayers.getValue()).intValue(),
        ((Integer)numberRounds.getValue()).intValue()
      );

      return new Game( namebox.getText(), bkoptions , ((Integer)humanplayers.getValue()).intValue() );

    }
    return null;

  }
View Full Code Here

Examples of nl.nuggit.words.play.Game

  private int yAdjustment;
  private Game game;

  public MainWindow() {

    game = new Game();
    game.addPlayer("p1", true);
    game.addPlayer("p2", true);

    Dimension windowSize = new Dimension(600, 800);
    layeredPane = new JLayeredPane();
View Full Code Here

Examples of nz.ac.massey.softwarec.group3.game.Game

     * Test of getGame method, of class Action.
     */
    @Test
    public void testGetGame() {
        System.out.println("getGame");
        Game result = actionTest.getGame();
        Game expResult = game;
        assertEquals(result, expResult);
    }
View Full Code Here

Examples of oop13.space.game.Game

   * @param gamePanel - The {@link oop13.space.views.GamePanelInterface} to observe
   */
  public void setView(GamePanelInterface gamePanel) {
    this.gamePanel = gamePanel;
    this.gamePanel.attachObserver(this);
    Game newGame = new Game(model, this);
    newGame.start();
  }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Game

    em.getTransaction().begin();
    Class[] classes = { Game.class, IndoorGame.class, Scrabble.class,
        Chess.class };
    for (Class cls : classes) {
      for (int i = 1; i <= 4; i++) {
        Game p = (Game) cls.newInstance();
        p.setName(cls.getSimpleName() + "-" + i);
        em.persist(p);
      }
    }
    em.getTransaction().commit();
  }
View Full Code Here

Examples of org.apache.wicket.examples.hangman.Game

   *
   * @throws Exception
   */
  public void test_1() throws Exception
  {
    Game hangman = new Game();
    hangman.newGame(5, new WordGenerator(new String[] { "testing" }));

    Assert.assertEquals(5, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    doGuessTest(hangman, 'a', false);
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    guess(hangman, 'a');
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    doGuessTest(hangman, 't', true);
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    doGuessTest(hangman, 'e', true);
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    doGuessTest(hangman, 's', true);
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    doGuessTest(hangman, 'i', true);
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    doGuessTest(hangman, 'n', true);
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

    doGuessTest(hangman, 'g', true);
    Assert.assertEquals(4, hangman.getGuessesRemaining());
    Assert.assertTrue(hangman.isWon());
    Assert.assertFalse(hangman.isLost());
  }
View Full Code Here

Examples of org.cspoker.server.embedded.gamecontrol.Game

    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();

    try {
      gameControl.call(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    // Flop Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    // Turn Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    // Final Round
    try {
      System.out.println("final round");
      gameControl.check(game.getCurrentPlayer());
      System.out.println("Check 1");
      gameControl.check(game.getCurrentPlayer());
      System.out.println("check 2");
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    GameFlowTest.logger.info("Next game...");

    GameFlowTest.logger.info("Current Player:" + game.getCurrentPlayer());
    GameFlowTest.logger.info("Next Dealer:" + game.getNextDealer());
    GameFlowTest.logger.info(game.getFirstToActPlayer());
    GameFlowTest.logger.info("Dealer: " + game.getDealer().getName());
    GameFlowTest.logger.info(game.getCurrentDealPlayers());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.