Examples of Game


Examples of org.scotlandyard.engine.Game

  }

  @Test  //TODO add description of what the test should do
  public final void testAddDetective() throws GameException{
    final User creator = new UserImpl("user1", "user1@game.com");
    Game game;
    try{
      game = GameImpl.getNewInstance("game1", creator, boardMap);
      Assert.assertTrue(false);
    }catch(GameException ex){
      Assert.assertTrue(true);
    }
    Assert.assertEquals(GameEngine.instance().getLobby().getAvailableGames().size(),0);
    GameEngine.instance().loginUser(creator);
    Assert.assertNotNull(GameEngine.instance().getUser(creator.getEmail()));
    Assert.assertEquals(GameEngine.instance().getUser(creator.getEmail()), creator);
    game = GameImpl.getNewInstance("game1", creator, boardMap);
    Assert.assertEquals(GameEngine.instance().getLobby().getAvailableGames().size(),1);
    Assert.assertEquals(game.getDetectives().size(),0);
    Assert.assertEquals(game.getPlayers().size(),0);
    final Player player = Detective.getNewInstance(game, creator);
    Assert.assertEquals(game.getDetectives().size(),1);
    Assert.assertEquals(game.getPlayers().size(),1);
    Assert.assertEquals(game.getPlayer(creator.getEmail()),player);
    Assert.assertEquals(game.getPlayer(player.getEmail()),player);
    Assert.assertEquals(creator.getEmail(),player.getEmail());
    Assert.assertEquals(creator.getName(),player.getName());
    Assert.assertNotNull(creator);
    Assert.assertNotNull(creator.getEmail());
    Assert.assertNull(game.getMrX());
    GameEngine.instance().logoutUser(creator.getEmail());
    try{
      game.removePlayer(creator.getEmail());
      Assert.assertFalse(true);
    }catch(GameException ex){
      Assert.assertTrue(true);
    }
    GameEngine.instance().getLobby().removeGame(game.getIdentifier());
    Assert.assertEquals(GameEngine.instance().getLobby().getAvailableGames().size(),0);
    GameEngine.instance().getBoardMaps().clear();

  }
View Full Code Here

Examples of org.scotlandyard.engine.Game

    }

    String playerEmail = GameEngine.instance().getUsers().get(getSessionId()).getEmail();


    final Game game =  engine.getLobby().getGame(gameId);
    if(!game.removePlayer(playerEmail)){
      throw new GameException("Player could not be removed");
    }

  }
View Full Code Here

Examples of org.scotlandyard.engine.Game

  @Test  //TODO add description of what the test should do
  public final void testGetBoardMap() throws GameException {
    Assert.assertEquals(GameEngine.instance().getLobby().getAvailableGames().size(), 0);
    Assert.assertEquals(GameEngine.instance().getBoardMaps().size(), 0);
    final Game game = GameImpl.getNewInstance(GAME, null, null);
    Assert.assertNull(game.getBoardMap());
    final BoardMap boardMap = BoardMapImpl.getNewInstance("pnth");
    game.setBoardMap(boardMap);
    Assert.assertNotNull(game.getBoardMap());
    Assert.assertSame(boardMap,game.getBoardMap());
    Assert.assertEquals(game.getBoardMap().getName(), boardMap.getName());
    game.setBoardMap(null);
    Assert.assertNull(game.getBoardMap());
    Assert.assertEquals(GameEngine.instance().getLobby().getAvailableGames().size(), 1);
    Assert.assertEquals(GameEngine.instance().getBoardMaps().size(), 1);
    GameEngine.instance().getBoardMaps().remove(boardMap.getName());
    GameEngine.instance().getLobby().removeGame(game.getIdentifier());
    Assert.assertEquals(GameEngine.instance().getLobby().getAvailableGames().size(), 0);
    Assert.assertEquals(GameEngine.instance().getBoardMaps().size(), 0);

  }
View Full Code Here

Examples of org.springframework.batch.core.test.football.Game

   
    if(fs == null){
      return null;
    }
   
    Game game = new Game();
    game.setId(fs.readString("id"));
    game.setYear(fs.readInt("year"));
    game.setTeam(fs.readString("team"));
    game.setWeek(fs.readInt("week"));
    game.setOpponent(fs.readString("opponent"));
    game.setCompletes(fs.readInt("completes"));
    game.setAttempts(fs.readInt("attempts"));
    game.setPassingYards(fs.readInt("passingYards"));
    game.setPassingTd(fs.readInt("passingTd"));
    game.setInterceptions(fs.readInt("interceptions"));
    game.setRushes(fs.readInt("rushes"));
    game.setRushYards(fs.readInt("rushYards"));
    game.setReceptions(fs.readInt("receptions", 0));
    game.setReceptionYards(fs.readInt("receptionYards"));
    game.setTotalTd(fs.readInt("totalTd"));
   
    return game;
  }
View Full Code Here

Examples of org.springframework.batch.sample.domain.football.Game

   
    if(fs == null){
      return null;
    }
   
    Game game = new Game();
    game.setId(fs.readString("id"));
    game.setYear(fs.readInt("year"));
    game.setTeam(fs.readString("team"));
    game.setWeek(fs.readInt("week"));
    game.setOpponent(fs.readString("opponent"));
    game.setCompletes(fs.readInt("completes"));
    game.setAttempts(fs.readInt("attempts"));
    game.setPassingYards(fs.readInt("passingYards"));
    game.setPassingTd(fs.readInt("passingTd"));
    game.setInterceptions(fs.readInt("interceptions"));
    game.setRushes(fs.readInt("rushes"));
    game.setRushYards(fs.readInt("rushYards"));
    game.setReceptions(fs.readInt("receptions", 0));
    game.setReceptionYards(fs.readInt("receptionYards"));
    game.setTotalTd(fs.readInt("totalTd"));
   
    return game;
  }
View Full Code Here

Examples of org.terasology.game.Game

        assetManager.setEnvironment(moduleManager.getEnvironment());
        CoreRegistry.putPermanently(CollisionGroupManager.class, new CollisionGroupManager());
        CoreRegistry.putPermanently(WorldGeneratorManager.class, new WorldGeneratorManager());
        CoreRegistry.putPermanently(ComponentSystemManager.class, new ComponentSystemManager());
        CoreRegistry.putPermanently(NetworkSystem.class, new NetworkSystemImpl(time));
        CoreRegistry.putPermanently(Game.class, new Game(this, time));
        assetManager.setEnvironment(moduleManager.getEnvironment());

        AssetType.registerAssetTypes(assetManager);
        ApplyModulesUtil.applyModules();
    }
View Full Code Here

Examples of pair.trivia.a20130524.Game

        CurrentPlayer currentPlayer = new CurrentPlayer(players);

        Questions questions = new Questions();

        Game aGame = new Game(currentPlayer, questions);

        boolean notAWinner;
        do {

            aGame.play(rand.nextInt(5) + 1);

            if (rand.nextInt(9) == 7) {
                notAWinner = aGame.wrongAnswer();
            } else {
                notAWinner = aGame.correctAnswer();
            }

        } while (notAWinner);
       
    }
View Full Code Here

Examples of pdp.scrabble.Game

   
    public SimpleAI(String name, int id, GameEnvironment env) {
  this.name = name;
  this.id = id;
  this.env = env;
  Game game = new GameImpl("blob", null); // TODO create game adapter to GameEnvironement & GameEngine
  this.deleg = new PlayerImpl(game, "name", id, true, new AIConfigImpl(SearchLevel.EASY, SearchStrategy.AUTOMATIC, SearchPriority.HIGHER_SCORE));
    }
View Full Code Here

Examples of plar.core.Game

    }
    return true;
  }

  public void newGame(Level l) {
    g = new Game();
    g.screenResolution = resolution;

    g.setLevel(l);
    g.startGame();
  }
View Full Code Here

Examples of scotlandyard.client.widget.game.Game

  private void createGame(){
    String[] players = new String[counter];
    for (int i = 0; i < counter; i++)
      players[i] = lblPlayers[i].getText();
   
    Game game = new Game(players);
    game.setMyName(myName);
    game.setCaseDescription(gameDescription);
   
    RootLayoutPanel.get().clear();
    RootLayoutPanel.get().add(game);
  }
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.