Package net.sertik.genesia.ui

Examples of net.sertik.genesia.ui.TileNode


    if (container.getChildren().isEmpty()) {
      List<Node> nodes = new LinkedList<>();
      for (int i = 0; i < world.getSizeSqrt(); i++) {
        for (int j = 0; j < world.getSizeSqrt(); j++) {
          Tile tile = world.getTile(i, j);
          TileNode node = resourceLoader.createResource(tile);
          if (node != null) {
            node.setLayoutX(World.TILE_WIDTH / 2 * (i - j));
            node.setLayoutY(World.TILE_HEIGHT / 2 * (i + j));
            nodes.add(node);
          }
        }
      }

View Full Code Here


  public abstract Node createResource(GameObject gameObject);

  public TileNode createResource(Tile tile) {
    if (!tile.getObjects().isEmpty()) {
      TileNode tileNode = new TileNode(tile);
      for (GameObject gameObject : tile.getObjects()) {
        tileNode.getChildren().add(createResource(gameObject));
      }

      Node landBorder = createLandBorder(tile.getX(), tile.getY(), tile.getLand());
      if (landBorder != null) {
        tileNode.getChildren().add(landBorder);
      }

      return tileNode;
    }
View Full Code Here

TOP

Related Classes of net.sertik.genesia.ui.TileNode

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.