Examples of MapPosition


Examples of de.fhpotsdam.unfolding.utils.MapPosition

    addLocations(toMarker.getLocation());
  }

  @Override
  public void draw(PGraphics pg, List<MapPosition> mapPositions) {
    MapPosition from = mapPositions.get(0);
    MapPosition to = mapPositions.get(1);
    pg.line(from.x, from.y, to.x, to.y);
  }
View Full Code Here

Examples of de.fhpotsdam.unfolding.utils.MapPosition

    }
    pg.strokeWeight(strokeWeight);
    pg.smooth();

    pg.beginShape(PConstants.LINES);
    MapPosition last = mapPositions.get(0);
    for (int i = 1; i < mapPositions.size(); ++i) {
      MapPosition mp = mapPositions.get(i);
      pg.vertex(last.x, last.y);
      pg.vertex(mp.x, mp.y);

      last = mp;
    }
View Full Code Here

Examples of de.fhpotsdam.unfolding.utils.MapPosition

    List<MapPosition> mapPositions = new ArrayList<MapPosition>();

    for (Location loc : getLocations()) {
      float[] xy = map.mapDisplay.getObjectFromLocation(loc);
      mapPositions.add(new MapPosition(xy));
    }

    draw(pg, mapPositions, properties, map);
  }
View Full Code Here

Examples of de.fhpotsdam.unfolding.utils.MapPosition

    pg.pushStyle();

    @SuppressWarnings("unchecked")
    List<Double> speedList = (List<Double>) properties.get("speedList");

    MapPosition oldPos = null;
    for (int i = 0; i < mapPositions.size(); i++) {
      MapPosition pos = mapPositions.get(i);
      if (i > 0) {       
        // Draw a line
        pg.strokeWeight(4);
        // Map speed to color of line
        pg.stroke(255 - PApplet.map(speedList.get(i).floatValue(), 0, 30, 0, 255),
View Full Code Here

Examples of org.iremake.common.model.map.MapPosition

        id = parent.getAttributeValueAsInt("id");
        name = parent.getAttributeValue("name");
        int row = parent.getAttributeValueAsInt("town-row");
        int column = parent.getAttributeValueAsInt("town-column");
        town = new MapPosition(row, column);
    }
View Full Code Here

Examples of org.iremake.common.model.map.MapPosition

            break;
        default:
            row = -1;
            column = -1;
        }
        return new MapPosition(row, column);
    }
View Full Code Here

Examples of org.iremake.common.model.map.MapPosition

        }
        return new MapPosition(row, column);
    }
   
    public boolean isSameTerrain(MapPosition p, TilesTransition t) {
        MapPosition q = getNeighbourPosition(p, t);
        if (containsPosition(p) && containsPosition(q) && map[p.row][p.column].terrainID == map[q.row][q.column].terrainID) {
            return true;
        }
        return false;
    }
View Full Code Here

Examples of org.iremake.common.model.map.MapPosition

        }
        return false;
    }
   
    public boolean isSameResource(MapPosition p, TilesTransition t) {
        MapPosition q = getNeighbourPosition(p, t);
        if (containsPosition(p) && containsPosition(q) && map[p.row][p.column].resourceID != Settings.RESOURCE_NONE && map[p.row][p.column].resourceID == map[q.row][q.column].resourceID) {
            return true;
        }
        return false;
    }   
View Full Code Here

Examples of org.iremake.common.model.map.MapPosition

    public TilesBorder getBorder(MapPosition p, TilesTransition transition) {
        // position has to belong to the map and there must be a province
        if (!containsPosition(p) || getTile(p).provinceID == Province.NONE) {
            return TilesBorder.None;
        }
        MapPosition p2 = getNeighbourPosition(p, transition);
        // neigboured postion must belong and there must be a province
        if (!containsPosition(p2) || getTile(p2).provinceID == Province.NONE) {
            return TilesBorder.None;
        }
        if (getTile(p).provinceID != getTile(p2).provinceID) {
View Full Code Here

Examples of org.iremake.common.model.map.MapPosition

        Random rnd = new Random(42);

        // set terrain
        for (int row = 0; row < rows; row++) {
            for (int column = 0; column < columns; column++) {
                MapPosition pos = new MapPosition(row, column);
                Tile tile = scenario.getTileAt(pos);
                int i = column + row * columns;

                // set terrains
                // sea
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.