Examples of addDetective()


Examples of org.scotlandyard.engine.Game.addDetective()

    boardMap.prepareMap("web/maps/pnth.xml");
    User user = UserImpl.getNewInstance("Hussain", "hussain@game.com");
    Game game = GameImpl.getNewInstance("new game", user,boardMap);
   
    Detective detective = new Detective(user);
    game.addDetective(detective);
   
    game.setPlayerPosition(detective.getEmail(), boardMap.getCoordinates().iterator().next().getLabel());
   
    GamePlayersJsonContainer container = new GamePlayersJsonContainer(game);
   
View Full Code Here

Examples of org.scotlandyard.engine.Game.addDetective()

    final Game game = GameImpl.getNewInstance(GAME, null, null);
    Assert.assertEquals(GameEngine.instance().getLobby().getAvailableGames().size(), 1);
    Assert.assertEquals(game.getDetectives().size(), 0);
    final Player player = new Detective(UserImpl.getNewInstance("s", "s"));
    Assert.assertEquals(GameEngine.instance().getUsers().size(), 1);
    game.addDetective((Detective)player);
    Assert.assertEquals(game.getDetectives().size(), 1);
    Assert.assertEquals(game.getPlayers().size(), 1);
    Assert.assertEquals(game.getPlayer("s"), player);
    Assert.assertTrue(game.removePlayer(player));
    Assert.assertEquals(game.getPlayers().size(), 0);
View Full Code Here

Examples of org.scotlandyard.engine.Game.addDetective()

    Assert.assertEquals(detective.compareTo(detective),0);


    game.addDetective((Detective) detective);
    game2.addDetective((Detective) detective);


    final Set<Game> currentgameslist = new HashSet<Game>();
    currentgameslist.add(game);
    currentgameslist.add(game2);
View Full Code Here

Examples of org.scotlandyard.engine.Game.addDetective()

    }catch(Exception ex){
      Assert.assertTrue(true);
    }

    try{
      game.addDetective((Detective)player2);
      Assert.assertFalse(true);
    }catch(Exception ex){
      Assert.assertTrue(true);
    }
View Full Code Here

Examples of org.scotlandyard.engine.Game.addDetective()

      Assert.assertFalse(true);
    }catch(Exception ex){
      Assert.assertTrue(true);
    }

    game.addDetective((Detective)player1);

    Assert.assertNotNull(game.getPlayer(user1.getEmail()));
    Assert.assertNotNull(game.getPlayer(user2.getEmail()));

    Assert.assertEquals(game.getDetectives().size(), 1);
View Full Code Here

Examples of org.scotlandyard.engine.Game.addDetective()

    }catch(Exception ex){
      Assert.assertTrue(true);
    }

    Assert.assertEquals(game.getDetectives().size(), 0);
    game.addDetective((Detective)player1);
    Assert.assertEquals(game.getDetectives().size(), 1);

    Assert.assertEquals(game.getPlayers().size(), 2);

    Assert.assertSame(game.getMrX(),player2);
View Full Code Here

Examples of org.scotlandyard.engine.Game.addDetective()

    Assert.assertTrue(game.getDetectives().contains(player1));

    Assert.assertFalse(game.getDetectives().contains(player2));

    try{
      game.addDetective((Detective)player2); //should not allow player to be both mrx and detective in the same game
      Assert.assertFalse(true);
    }catch(Exception ex){
      Assert.assertTrue(true);
    }
View Full Code Here

Examples of org.scotlandyard.engine.Game.addDetective()

    }catch(Exception ex){
      Assert.assertTrue(true);
    }

    try{
      game.addDetective((Detective)player1); //should not allow player to be added as detective twice
      Assert.assertFalse(true);
    }catch(Exception ex){
      Assert.assertTrue(true);
    }
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.