Tabnine Logo
IGraphicsBackgroundListener
Code IndexAdd Tabnine to your IDE (free)

How to use
IGraphicsBackgroundListener
in
jsettlers.common.map

Best Java code snippets using jsettlers.common.map.IGraphicsBackgroundListener (Showing top 6 results out of 315)

origin: jsettlers/settlers-remake

public final void setHeightAt(short x, short y, byte height) {
  this.heightGrid[x + y * width] = height;
  backgroundListener.backgroundShapeChangedAt(x, y);
}
origin: jsettlers/settlers-remake

public void flattenAndChangeHeightTowards(int x, int y, byte targetHeight) {
  final int index = x + y * width;
  this.heightGrid[index] += Math.signum(targetHeight - this.heightGrid[index]);
  this.landscapeGrid[index] = ELandscapeType.FLATTENED.ordinal;
  this.temporaryFlatened[index] = Byte.MAX_VALUE; // cancel the flattening
  backgroundListener.backgroundShapeChangedAt(x, y);
}
origin: jsettlers/settlers-remake

public final void setLandscapeTypeAt(int x, int y, ELandscapeType landscapeType) {
  if (landscapeType == ELandscapeType.FLATTENED && this.landscapeGrid[x + y * width] != ELandscapeType.FLATTENED.ordinal) {
    flattenedResetter.addPosition(x, y);
  }
  this.landscapeGrid[x + y * width] = landscapeType.ordinal;
  backgroundListener.backgroundShapeChangedAt(x, y);
}
origin: jsettlers/settlers-remake

public void setHeight(int x, int y, int height) {
  byte safeHeight;
  if (height >= Byte.MAX_VALUE) {
    safeHeight = Byte.MAX_VALUE;
  } else if (height <= 0) {
    safeHeight = 0;
  } else {
    safeHeight = (byte) height;
  }
  undoDelta.addHeightChange(x, y, heights[x][y]);
  heights[x][y] = safeHeight;
  if (backgroundListener != null) {
    backgroundListener.backgroundShapeChangedAt((short) x, (short) y);
  }
}
origin: jsettlers/settlers-remake

private boolean setLandscape(int x, int y, ELandscapeType type) {
  if (objects[x][y] != null) {
    if (!landscapeAllowsObjects(type)) {
      return false;
    }
    if (objects[x][y] instanceof LandscapeConstraint) {
      LandscapeConstraint constraint = (LandscapeConstraint) objects[x][y];
      if (!constraint.getAllowedLandscapes().contains(type)) {
        return false;
      }
    }
  }
  undoDelta.addLandscapeChange(x, y, landscapes[x][y]);
  landscapes[x][y] = type;
  if (backgroundListener != null) {
    backgroundListener.backgroundShapeChangedAt((short) x, (short) y);
  }
  return true;
}
origin: jsettlers/settlers-remake

inverse.addHeightChange(c.x, c.y, heights[c.x][c.y]);
heights[c.x][c.y] = c.height;
backgroundListener.backgroundShapeChangedAt(c.x, c.y);
c = c.next;
inverse.addLandscapeChange(cl.x, cl.y, landscapes[cl.x][cl.y]);
landscapes[cl.x][cl.y] = cl.landscape;
backgroundListener.backgroundShapeChangedAt(cl.x, cl.y);
cl = cl.next;
jsettlers.common.mapIGraphicsBackgroundListener

Javadoc

This interface can be used by the user of the IGraphicsGrid to get notified if the background (landscape type or height) has changed.

Most used methods

  • backgroundShapeChangedAt
    This method is called if the landscape type or height has changed at the given position.

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Runner (org.openjdk.jmh.runner)
  • Top plugins for WebStorm
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