Package net.yura.lobby.database.impl

Examples of net.yura.lobby.database.impl.JPADatabase$Interaction


        catch (Exception ex) {
            throw new RuntimeException(ex);
        }

        //database = new net.yura.lobby.database.impl.MemoryDatabase();
        database = new JPADatabase();

        TurnBasedGame.scheduler.pause();
        loadFromDB();
        TurnBasedGame.scheduler.resume();
View Full Code Here


    }

    @Test
    public void testSaveGame() {
        System.out.println("saveGame");
        Database database = new JPADatabase();
       
        database.startTransaction();
        GameTypeRoom gameTypeRoom = database.getGameTypes().iterator().next();
        database.endTransaction();
       
        User user = new User();
       
        database.startTransaction();
        database.saveUser(user);
        database.endTransaction();
       
        GameRoom gameRoom = new GameRoom();
        gameRoom.setName("Test Game Room");
        gameRoom.setMaxPlayers(2);
        gameRoom.setOptions("0\n2\n2\nchoosemap sersom.map\nstartgame domination increasing");

        gameRoom.setGameTypeRoom(gameTypeRoom);
        gameTypeRoom.getGameRooms().add(gameRoom);
       
        gameRoom.getUsers().add(user);
        user.getGames().add(gameRoom);
       
        database.startTransaction();
        database.saveGame(gameRoom);
        database.endTransaction();

        User user2 = new User();
       
        database.startTransaction();
        database.saveUser(user2);
        database.endTransaction();

        gameRoom.getUsers().add(user2);
        user2.getGames().add(gameRoom);

        database.startTransaction();
        database.saveGame(gameRoom);
        database.endTransaction();
       
    }
View Full Code Here

    for (Object o : getNodes())
    {
      Node node = (Node) o;

      Interaction inter = null;

      if (node instanceof ChbConversion)
      {
        inter = ((ChbConversion) node).getConversion();
      }
      else if (node instanceof ChbControl)
      {
        inter = ((ChbControl) node).getControl();
      }
      else if (node instanceof Hub)
      {
        inter = ((Hub) node).getInteraction();
      }

      if (inter != null)
      {
        if (!interactionMap.containsKey(inter))
        {
          interactionMap.put(inter, new ArrayList<GraphObject>());
        }
        interactionMap.get(inter).add(node);
      }
    }

    for (Object o : getEdges())
    {
      Interaction inter = null;

      if (o instanceof NonModulatedEffector)
      {
        inter = ((NonModulatedEffector) o).getControl();
      }
View Full Code Here

TOP

Related Classes of net.yura.lobby.database.impl.JPADatabase$Interaction

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.