Examples of Game


Examples of scotlandyard.engine.impl.Game

    Engine.instance().logout(detectiveHash);
  }

  @Test
  public void testGetMoves(){
    Game game = Engine.instance().games.get(gameId);
    IPlayer player = game.getPlayer(mrxHash);
    player.setPosition(1);
    Integer[] moves = game.getLegalMoves(player.getEmail());
    Assert.assertTrue(contains(moves,16));
  }
View Full Code Here

Examples of scotlandyard.engine.impl.Game

    Assert.assertTrue(contains(moves,16));
  }
 
  @Test
  public void testGetMovesWithMissingTicket(){
    Game game = Engine.instance().games.get(gameId);
    IPlayer player = game.getPlayer(mrxHash);
    player.setTickets(4, 0);
    player.setPosition(1);
    Integer[] moves = game.getLegalMoves(player.getEmail());
    Assert.assertTrue(!contains(moves,16));
    player.setTickets(0, 0);
    moves = game.getLegalMoves(player.getEmail());
    Assert.assertTrue(!contains(moves,1));
  }
View Full Code Here

Examples of scotlandyard.engine.impl.Game

  }
 
  @Test
  public void testincreaseMrxTokens()
  {
    Game game = Engine.instance().games.get(gameId);
    IPlayer mrXplayer = game.getPlayer(mrxHash);
    IPlayer detectivePlayer = game.getPlayer(detectiveHash);
                mrXplayer.setPosition(4);
                try
                {
                    game.movePlayer(mrXplayer.getEmail(), 5, 2);
                }
                catch (Exception e)
                {
                    Assert.assertTrue(false);
                }

    detectivePlayer.setPosition(2);
    try {
      int before = detectivePlayer.getTickets(1);
      game.movePlayer(detectiveEmail, 3, 1);
      int after = detectivePlayer.getTickets(1);
      if(after != (before - 1))
      {
        Assert.assertEquals("detective tickets havent ben decreased properly", 2, 3);
      }
View Full Code Here

Examples of scotlandyard.engine.impl.Game

      int counter=0;
      for(final IGame game:Engine.instance().games.values()){
        counter+=(game.getMapPath().equals(map_path)?1:0);
      }
      counter++;
      final Game game = new Game(game_id+" ("+counter+")",mp);
     
      Engine.instance().games.put(game.getId(),game);
        game.setMapPath(map_path);
       
        return "{\"msg\":\"OK\"}";
       
    }catch(Exception e){
      return ("{\"msg\" : \"EXCEPTION : "+(e.getMessage()+"").replace("\"", "'")+"\", \"className\" : \""+getClass().getName()+"\"}");
View Full Code Here

Examples of si.unimb.cot.mgbl.gamemgmt.datamodel.Game

    //reset(null);
  }
 
  public void reset() {
    //call reset() when in use!
    game=new Game();
    allowBrowseForUsers=new ArrayList<User>();
    allowPlayForUsers=new ArrayList<User>();
    allowEditForUsers=new ArrayList<User>();
    allowViewScoresForUsers=new ArrayList<User>();
    allowAllForUsers=new ArrayList<User>();
View Full Code Here

Examples of voodoo.collection.gameplay.Game

   
    private static int PLAYER_LIFE = 10;
    private int _numPlayers = 2; // For now
   
    public GameBeginRulesCard() {
        Game game = Game.getInstance();
       
        game.resetEndCheck();
       
        // Register for game begin event
        game.registerForEvent( this, Event.INIT_GAME_EVENT );
        _action.setEffect( new CreatePlayersEffect( _numPlayers ) ); // Must do this first!
        _action.addEffect( new SetAllPlayersLifeEffect( PLAYER_LIFE ) );
    }
View Full Code Here

Examples of voodoo.framework.Game

 
  /**
   * @param args Game to run.
   */
  public static void main(String[] args) {
    new Game(getGameObjectFactory(args[0]));
  }
View Full Code Here

Examples of vrampal.connectfour.core.Game

  private GameData gameData;

  @Before
  public void setUp() {
    GameFactory gameFactory = GameFactoryImpl.getInstance();
    Game game = gameFactory.createGame();

    game.begin();
    game.dropDisc(3);
    game.dropDisc(2);
    game.dropDisc(5);
    game.dropDisc(2);
    game.dropDisc(3);

    gameData = new GameData(game);
  }
View Full Code Here

Examples of world.Game

  }
 
  private static void init(){
    anim = new Anim();
   
    game = new Game();
    editor = new Editor();
   
    menuGame = new MenuGame();
    menuEditor = new MenuEditor();
  }
View Full Code Here

Examples of zelda.engine.Game

  public Main()
  {
    setIgnoreRepaint(true);

    game = new Game();

    if(game.isDebug())
    {
      setLocationRelativeTo(null);
      setSize(game.getWidth(), game.getHeight());
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.