Examples of World


Examples of hello.domain.World

      try (ResultSet results = statement.executeQuery())
      {
        if (results.next())
        {
          worlds[i] = new World(id, results.getInt("randomNumber"));
        }
      }
    }

    if (count == 1)
View Full Code Here

Examples of hellowicket.World

                       "UPDATE World SET randomNumber = ? WHERE id= ?"))
          {
            for (int i = 0; i < queries; i++)
            {
              query.setInt(1, random.nextInt(DB_ROWS) + 1);
              World world;
              try (ResultSet resultSet = query.executeQuery())
              {
                resultSet.next();
                world = new World(
                    resultSet.getInt("id"),
                    resultSet.getInt("randomNumber"));
              }
              world.randomNumber = random.nextInt(DB_ROWS) + 1;
              update.setInt(1, world.randomNumber);
View Full Code Here

Examples of iryrwarosh.World

    else
      return this;
  }
 
  private Screen newGame(Factory factory, Item item1, Item item2){
    World world = new Worldgen(80 / 3, 24 / 3).build();
   
    Creature player = factory.player(world);
    player.swapLeftHand(world, item1);
    player.swapRightHand(world, item2);
   
    for (int i = 0; i < 80; i++)
      factory.zora(world);
   
    for (int i = 0; i < 100; i++)
      factory.goblin(world);

    for (int i = 0; i < 4; i++)
      factory.rival(world);
   
    for (Tile biome : new Tile[]{
        Tile.GREEN_TREE1, Tile.GREEN_TREE1, Tile.GREEN_TREE1,
        Tile.BROWN_TREE1, Tile.BROWN_TREE1, Tile.BROWN_TREE1, 
        Tile.WHITE_TREE1,
        Tile.GREEN_ROCK, Tile.GREEN_ROCK, Tile.GREEN_ROCK,
        Tile.BROWN_ROCK, Tile.BROWN_ROCK, Tile.BROWN_ROCK,
        Tile.WHITE_ROCK, 
        Tile.GREEN_TREE1, Tile.GREEN_TREE1, Tile.GREEN_TREE1,
        Tile.BROWN_TREE1, Tile.BROWN_TREE1, Tile.BROWN_TREE1, 
        Tile.WHITE_TREE1,
        Tile.GREEN_ROCK, Tile.GREEN_ROCK, Tile.GREEN_ROCK,
        Tile.BROWN_ROCK, Tile.BROWN_ROCK, Tile.BROWN_ROCK,
        Tile.WHITE_ROCK,
        Tile.DESERT_SAND1, Tile.WATER1 }){
      for (int i = 0; i < 10; i++)
        factory.monster(world, biome);
    }

    for (Point screen : world.map().getDeadEnds()){
      if (world.map().screen(screen.x, screen.y).defaultWall == Tile.WHITE_WALL){
        factory.miniboss(world, screen.x, screen.y);
        world.add(factory.lostArtifact(), screen.x * 19 + 19 / 2, screen.y * 9 + 9 / 2);
      } else {
        switch ((int)(Math.random() * 5)){
        case 0: world.addToScreen(factory.evasionPotion(), screen.x, screen.y); break;
        case 1: world.addToScreen(factory.heartContainer(), screen.x, screen.y); break;
        default: factory.miniboss(world, screen.x, screen.y); break;
        }
      }
    }
   
    world.update();
    MessageBus.publish(new WorldCreated(world, player, "The world has been created."));
   
    return new PlayScreen(world, factory, player);
  }
View Full Code Here

Examples of it.marteEngine.World

  public void initStatesList(GameContainer container) throws SlickException {
    initRessources();

    StaticActor helloWorld = new StaticActor(300, 250, 35, 35,
        ResourceManager.getImage("hello"));
    World world = new World(0, container);
    world.add(helloWorld);

    addState(world);

  }
View Full Code Here

Examples of model.World

    @Transactional
    public void generateWorldsForTest() {

        for (int i = 0; i < 10000; i++) {

            World world = new World();
            world.randomNumber = i; // not really a random number. But we can test with that...
            entitiyManagerProvider.get().persist(world);

        }
View Full Code Here

Examples of models.World

  public static void setup() {
   
    //JPAPlugin plugin = play.Play.plugin(JPAPlugin.class);
    //plugin.startTx(true);
    World w = new World() ;
    w.getPersistenceManager().beginTransaction();

    // clean out the old
    World.deleteAll();
    System.out.println("DELETED");
    // in with the new
    List<World> worlds = new ArrayList<World>() ;
    for (long i = 0; i <= TEST_DATABASE_ROWS; i++) {
      int randomNumber = random.nextInt(TEST_DATABASE_ROWS) + 1;
      worlds.add(new World(i, randomNumber));
      if (i % 100 == 0) {
       

        World.batch().insert(worlds) ;
        System.out.println("FLUSHED : " + i + "/" + TEST_DATABASE_ROWS);
        worlds.clear() ;
      }
    }
    System.out.println("ADDED");
    //plugin.closeTx(false);
    w.getPersistenceManager().commitTransaction();

  }
View Full Code Here

Examples of models.World

    Job<List<World>> job = new Job<List<World>>() {
      public java.util.List<World> doJobWithResult() throws Exception {
        for (int i = 0; i < queryCount; ++i) {
          Long id = Long
              .valueOf(random.nextInt(TEST_DATABASE_ROWS) + 1);
          World result = World.findById(id);
          worlds.add(result);
        }
        return worlds;
      };
    };
View Full Code Here

Examples of models.World

    if (queries == 0)
      queries = 1;
    final List<World> worlds = new ArrayList<World>();
    for (int i = 0; i < queries; ++i) {
      Long id = Long.valueOf(random.nextInt(TEST_DATABASE_ROWS) + 1);
      World result = World.findById(id);
      worlds.add(result);
    }
    renderJSON(worlds);
  }
View Full Code Here

Examples of models.World

            public List<World> apply() throws Throwable {
                Random random = ThreadLocalRandom.current();
                List<World> worlds = new ArrayList<World>(n);
                for (int i = 0; i < n; ++i) {
                    long randomId = random.nextInt(TEST_DATABASE_ROWS) + 1;
                    World world = World.findById(randomId);
                    worlds.add(world);
                }
                return worlds;
            }
        }, dbEc);
View Full Code Here

Examples of models.World

            public List<World> apply() {
                Random random = ThreadLocalRandom.current();
                List<World> worlds = new ArrayList<World>(n);
                for (int i = 0; i < n; ++i) {
                    long randomId = random.nextInt(TEST_DATABASE_ROWS) + 1;
                    World world = World.find.byId(randomId);
                    worlds.add(world);
                }
                return worlds;
            }
        }, dbEc);
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.