Esempio n. 1
0
  /** @param p */
  public void addPoint(Point p) {
    Collection<Point> contained = getContainedSet();
    Terrain terrain = Main.getWorld().getTerrain();

    if (!terrain.isValidPoint(p)) {
      return;
    }

    if (containsPoint(p)) {
      return;
    }

    TerrainTile tile = terrain.getTerrainTile(p);

    tile.addLocationComponent(this);
    contained.add(p);
  }
Esempio n. 2
0
  /** @param p */
  public void removePoint(Point p) {
    Collection<Point> contained = getContainedSet();

    if (!contained.contains(p)) {
      return;
    }

    Terrain terrain = Main.getWorld().getTerrain();

    if (!terrain.isValidPoint(p)) {
      return;
    }

    TerrainTile tile = terrain.getTerrainTile(p);

    tile.removeLocationComponent(this);
    contained.remove(p);
  }