Examples of Tile


Examples of aurelienribon.slidinglayout.SLConfig.Tile

      if (isPartOf(c, cmpsWithStartSide)) {
        cfg.getPanel().add(c, new Integer(1));
        startTiles.put(c, cfg.getTile(c).clone());
      } else {
        cmpsToAddAfterTransition.add(c);
        Tile t = cfg.getTile(c);
        c.setBounds(t.x, t.y, t.w, t.h);
        c.validate();
      }
    }

    // If old components have an end side, their target location will be
    // computed later, and they will be removed at the end of the
    //transition. Else, they are directly removed from the panel.
    for (Component c : oldCmps) {
      if (isPartOf(c, cmpsWithEndSide)) {
        cmpsToRemoveAfterTransition.add(c);
        targetTiles.put(c, prevKf.cfg.getTile(c).clone());
      } else {
        cfg.getPanel().remove(c);
      }
    }

    // Start/target locations are computed for new/old components
    // that have a start/end side set.
    for (SLSide s : SLSide.values()) {
      hideTiles(getTiles(cmpsWithStartSide.get(s), startTiles), s);
      hideTiles(getTiles(cmpsWithEndSide.get(s), targetTiles), s);
    }

    // New components with a start side are then placed at the location
    // computed above.
    for (Component c : startTiles.keySet()) {
      Tile t = startTiles.get(c);
      c.setBounds(t.x, t.y, t.w, t.h);
      c.validate();
    }
  }
View Full Code Here

Examples of aurelienribon.slidinglayout.SLConfig.Tile

    if (timeline != null) timeline.kill();

    timeline = Timeline.createParallel();

    for (Component c : kf.getCmps()) {
      Tile t = kf.getTarget(c);

      int dx = c.getX() - t.x;
      int dy = c.getY() - t.y;
      int dw = c.getWidth() - t.w;
      int dh = c.getHeight() - t.h;
View Full Code Here

Examples of board.Tile

      Tile[]    result = new Tile[4];
      Location[]  footprint = getFootprint();
     
      System.out.print(getShapeTypeName() + " dissolves into");
      for (int i = 0; i < footprint.length; ++i) {
        result[i] = new Tile(footprint[i]);
        System.out.print(" " + result[i]);
      }
     
      System.out.println();
      return result;
View Full Code Here

Examples of ca.vanzeben.game.level.tiles.Tile

    protected boolean isSolidTile(int xa, int ya, int x, int y) {
        if (level == null) {
            return false;
        }
        Tile lastTile = level.getTile((this.x + x) >> 3, (this.y + y) >> 3);
        Tile newTile = level.getTile((this.x + x + xa) >> 3, (this.y + y + ya) >> 3);
        if (!lastTile.equals(newTile) && newTile.isSolid()) {
            return true;
        }
        return false;
    }
View Full Code Here

Examples of ch.fusun.baron.map.Tile

    int width = mapService.getWidth();
    int height = mapService.getHeight();
    for (int i = -1; i < 2; i++) {
      for (int j = -1; j < 2; j++) {
        if (i * j == 0) {// Not diagonal, not the center itself
          Tile current = mapService.getTile((tile.getX() + i + width)
              % width, (tile.getY() + j + height) % height);
          if (country.equals(propertyService.getOwnership(current))) {
            return true;
          }
        }
View Full Code Here

Examples of ch.fusun.baron.map.Tile

    }
    return newLand;
  }

  private Tile getNearestCityLocation(Tile tile, Collection<City> cities) {
    Tile nearestLocation = new Tile(Integer.MAX_VALUE, Integer.MAX_VALUE);
    double nearestDistance = Double.MAX_VALUE;
    for (City city : cities) {
      Tile cityLocation = cityService.getLocation(city);
      if (cityLocation.absoluteDistanceTo(tile) < nearestDistance) {
        nearestDistance = cityLocation.absoluteDistanceTo(tile);
        nearestLocation = cityLocation;
      }
    }
    return nearestLocation;
  }
View Full Code Here

Examples of ch.fusun.baron.map.Tile

  @Override
  public void execute(Object object) {
    if (object instanceof Unit) {
      Unit unit = (Unit) object;
      Tile location = unitService.getLocation(unit);
      Dynasty dynasty = playerService.getDynasty(userService.getUser());
      int width = mapService.getWidth();
      int height = mapService.getHeight();
      clientService.execute(new MoveUnitCommand(dynasty, unit, new Tile(
          (location.getX() + getHorizontalDiff() + width) % width,
          (location.getY() + getVerticalDiff() + height) % height)));
    }
  }
View Full Code Here

Examples of ch.fusun.baron.map.Tile

    return null;
  }

  @Override
  public void moveUnit(Unit unit, Tile destination) {
    Tile location = getLocation(unit);
    if (location != null) {
      removeUnit(unit);
      addUnitToLocation(destination, unit);
    }
  }
View Full Code Here

Examples of ch.fusun.baron.map.Tile

    return false;
  }

  @Override
  public void removeUnit(Unit unit) {
    Tile location = getLocation(unit);
    Collection<Unit> units = getUnits(location);
    units.remove(unit);
    updateAllListeners(new RemoveUnitDataUpdate(unit));
  }
View Full Code Here

Examples of ch.fusun.baron.map.Tile

  public void execute() {
    for (Country country : countryService.getCountries()) {
      Collection<Farm> farms = getFarmsForCountry(country);
      Collection<City> cities = getCitiesForCountry(country);
      for (City city : cities) {
        Tile location = cityService.getLocation(city);
        int food = getNumberOfFarmsNearestTo(location, cities, farms);
        city.setPopulation(Math.min(city.getPopulation(), food));
        if (city.isDead()) {
          cityService.removeCity(city);
        }
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.