Tabnine Logo
IMapArea.contains
Code IndexAdd Tabnine to your IDE (free)

How to use
contains
method
in
jsettlers.common.map.shapes.IMapArea

Best Java code snippets using jsettlers.common.map.shapes.IMapArea.contains (Showing top 5 results out of 315)

origin: jsettlers/settlers-remake

@Override
public boolean contains(int x, int y) {
  return 0 <= x && x < width && 0 <= y && y < height && base.contains(x, y);
}
origin: jsettlers/settlers-remake

/**
 * This method checks if the point is contained by the map and by the shape.
 */
@Override
public boolean contains(ShortPoint2D position) {
  return inMap(position) && base.contains(position);
}
origin: jsettlers/settlers-remake

private void testShapeIterator(IMapArea circle) {
  boolean[][] foundByIterator = new boolean[TEST_WIDTH][TEST_WIDTH];
  for (ShortPoint2D pos : circle) {
    foundByIterator[pos.x][pos.y] = true;
  }
  for (int x = 0; x < TEST_WIDTH; x++) {
    for (int y = 0; y < TEST_WIDTH; y++) {
      assertEquals("contains() inconsistent with iterator for " + x + "," + y, circle.contains(new ShortPoint2D(x, y)),
          foundByIterator[x][y]);
    }
  }
}
origin: jsettlers/settlers-remake

  /**
   * Removes all construction marks in the given area.
   * 
   * @param area
   *            The area to remove the marks
   * @param notIn
   *            The area of marks that should be skipped.
   */
  private void removeConstructionMarks(IMapArea area, IMapArea notIn) {
    area.stream()
        .filterBounds(map.getWidth(), map.getHeight())
        .filter((x, y) -> !notIn.contains(x, y))
        .forEach((x, y) -> map.setConstructMarking(x, y, false, false, null));
  }
}
origin: jsettlers/settlers-remake

for (int x = xmin; x < xmax; x++) {
  if (area.contains(new ShortPoint2D(x, y))) {
    for (EDirection dir : EDirection.VALUES) {
      int tx = x + dir.getGridDeltaX();
jsettlers.common.map.shapesIMapAreacontains

Javadoc

Checks whether the given position is contained by the shape.

It is not guaranteed that they are also on the map.

Popular methods of IMapArea

  • stream
  • iterator
    Gets an iterator for the shape that returns all tiles that are contained by this shape. The iterator

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now