Examples of Tile


Examples of ch.fusun.baron.map.Tile

  private int getNumberOfFarmsNearestTo(Tile location,
      Collection<City> cities, Collection<Farm> farms) {
    int food = 0;
    for (Farm farm : farms) {
      Tile farmLocation = farmService.getLocation(farm);
      double shortestDistance = Double.MAX_VALUE;
      Tile nearestLocation = new Tile(Integer.MAX_VALUE,
          Integer.MAX_VALUE);
      for (City city : cities) {
        Tile cityLocation = cityService.getLocation(city);
        if (farmLocation.absoluteDistanceTo(cityLocation) <= shortestDistance) {
          nearestLocation = cityLocation;
          shortestDistance = farmLocation
              .absoluteDistanceTo(cityLocation);
        }
View Full Code Here

Examples of ch.fusun.baron.map.Tile

  @Override
  public void initialize() {
    for (Country country : countryService.getCountries()) {
      boolean ok = false;
      do {
        Tile tile = getRandomTile();
        if (crossAroundTileIsFree(tile)) {
          setCrossOwnerShipAroundTile(tile, country);
          ok = true;
        }
      } while (!ok);
View Full Code Here

Examples of ch.fusun.baron.map.Tile

  private Tile getRandomTile() {
    int width = mapService.getWidth();
    int height = mapService.getHeight();
    int x, y;
    Tile tile;
    do {
      x = (int) (width * Math.random());
      y = (int) (height * Math.random());
      tile = mapService.getTile(x, y);
    } while (propertyService.isOwned(tile));
View Full Code Here

Examples of chunmap.raster.Tile

import chunmap.raster.Tile;
import chunmap.util.image.ImageUtil;

public class StaticGMConn extends GMConnection {
  public Image getImage(GMTile tile_) {
    Tile tile = (tile_.proxy == null) ? tile_ : tile_.proxy;

    String name = tile.toString();
    Image image = cache.find(name);
    if (image != null)
      return image;

    CPoint p=tile.getEnvelop().getCenter();
//    Mercator proj=new Mercator();
//    p=proj.getReverseTransform().convert(p);
   
    String url = getString(p.getX(),p.getY(), tile.z);
    try {
View Full Code Here

Examples of com.ardor3d.extension.terrain.util.Tile

                    final int sourceY = tileY + i - cacheSize / 2;

                    final int destX = MathUtils.moduloPositive(sourceX, cacheSize);
                    final int destY = MathUtils.moduloPositive(sourceY, cacheSize);

                    newTiles.add(new TileLoadingData(mailBox, new Tile(sourceX, sourceY), new Tile(destX, destY),
                            source, cache, data, tileSize, dataSize, clipmapLevel, requestedLevel));
                }
            }

            final Iterator<TileLoadingData> tileIterator = currentTiles.iterator();
View Full Code Here

Examples of com.blitline.image.functions.Tile

  public static Stegano steganoWatermark(URI src) {
    return new Stegano(src);
  }

  public static Tile tile(String srcUrl) {
    return new Tile(srcUrl);
  }
View Full Code Here

Examples of com.hobbitsadventure.model.Tile

      int baseY = (i - minI) * TILE_HEIGHT;
      for (int j = minJ; j <= maxJ; j++) {
        int colIndex = (numCols + j) % numCols;
       
        // Paint tile
        Tile tile = realmMap.getTile(rowIndex, colIndex);
        int x = (j - minJ) * TILE_WIDTH;
        tile.paint(g, x, baseY);
       
        // Paint thing if it's occluded by subsequent tile roles
        Thing thing = realmMap.getThing(rowIndex, colIndex);
        if (thing != null && thing.isOccludedByTerrain()) {
          int y = baseY - 65 + tile.getHeight();
          g.drawImage(thing.getSprite(), x, y, null);
        }
      }
    }
  }
View Full Code Here

Examples of com.isteinvids.untrusted.level.Tile

        int charheight = g.getFontMetrics().getHeight();
        g.setColor(new Color(levelManager.backgroundColour));
        g.fillRect(offx, offy + (blocksizey / 2) - g.getFontMetrics().getHeight(), (levelManager.getWidth() * blocksizex) + 20, (levelManager.getHeight() * blocksizey) + charheight - 5);

        for (Map.Entry<Position, String> ents : levelManager.tiles.entrySet()) {
            Tile tile = levelManager.blockMapping.get(ents.getValue());
            g.setColor(Color.BLACK);
            g.drawString(Character.toString(tile.getSymbol()), offx + (ents.getKey().x * blocksizex) + 1, offy + (ents.getKey().y * blocksizey) + 1);
            g.setColor(new Color(tile.getColour()));
            g.drawString(Character.toString(tile.getSymbol()), offx + (ents.getKey().x * blocksizex), offy + (ents.getKey().y * blocksizey));
        }

        for (Map.Entry<Position, Integer> ents : levelManager.squareColours.entrySet()) {
            g.setColor(new Color(ents.getValue()));
            g.fillRect(offx + (ents.getKey().x * blocksizex), offy + (ents.getKey().y * blocksizey), blocksizex, blocksizey);
View Full Code Here

Examples of com.jcloisterzone.board.Tile

            return ((FarmScoreContext) featureCtx).getPoints(aiPlayer.getPlayer());
        }
    }

    private double futureConnectionRateConnection(Game game, Location toEmpty, Location toFeature, Position f2Pos, double chance) {
        Tile tile1 = game.getCurrentTile();
        Tile tile2 = game.getBoard().get(f2Pos);

        double rating = 0;

        Completable f1 = (Completable) tile1.getFeaturePartOf(toEmpty);
        Completable f2 = (Completable) tile2.getFeaturePartOf(toFeature.rev());

        if (f1 != null && f2 != null) {
            if (f1.getClass().equals(f2.getClass())) {
                //            System.err.println("    " + tile1.getPosition() + " <-->" + f2Pos + " / " + f1 + " " + f2);
                rating +=  futureConnectionRateFeatures(game, toEmpty, toFeature, chance, f1, f2);
            } else {
                rating +=  futureConnectionRateCrossing(game, toEmpty, toFeature, chance, f1, f2);
            }
        }

        if (toEmpty != toFeature) {
            boolean left = toEmpty.rotateCCW(Rotation.R90) == toFeature;
            Farm farm1 = (Farm) tile2.getFeaturePartOf(left ? toEmpty.getLeftFarm() : toEmpty.getRightFarm());
            Farm farm2 = (Farm) tile2.getFeaturePartOf(left ? toFeature.rev().getRightFarm() : toFeature.rev().getLeftFarm());

            if (farm1 != null && farm2 != null) {
//                System.err.println("    " + tile1.getPosition() + " <-->" + f2Pos + " / " + farm1 + " " + farm2);
                rating +=  futureConnectionRateFeatures(game, toEmpty, toFeature, chance, farm1, farm2);
            }
View Full Code Here

Examples of com.l2client.controller.area.Tile

   * @param args
   */
  public static void main(String[] args) {
    //set the cache drastically low
    navMan.setCacheSize(10);
    Tile t = new Tile(9999, 9999);
    int code = t.hashCode();
    System.gc();
    long sTot, sFree, sMax;
    long dTot, dFree;
    sTot = Runtime.getRuntime().totalMemory();
    sFree = Runtime.getRuntime().freeMemory();
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.