congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SelectAreaAction
Code IndexAdd Tabnine to your IDE (free)

How to use
SelectAreaAction
in
jsettlers.common.action

Best Java code snippets using jsettlers.common.action.SelectAreaAction (Showing top 2 results out of 315)

origin: jsettlers/settlers-remake

private void updateSelectionArea(UIPoint mousePosition, boolean finished) {
  if (finished && currentSelectionAreaStart != null) {
    int x1 = (int) mousePosition.getX();
    int x2 = (int) this.currentSelectionAreaStart.getX();
    int y1 = (int) mousePosition.getY();
    int y2 = (int) this.currentSelectionAreaStart.getY();
    if (x1 > x2) {
      int temp = x1;
      x1 = x2;
      x2 = temp;
    }
    if (y1 > y2) {
      int temp = y1;
      y1 = y2;
      y2 = temp;
    }
    IMapArea area = this.context.getRectangleOnScreen(x1, y1, x2, y2);
    getInterfaceConnector().fireAction(new SelectAreaAction(area));
    this.currentSelectionAreaStart = null;
    this.currentSelectionAreaEnd = null;
  } else {
    this.currentSelectionAreaEnd = mousePosition;
    updateSelectionArea = true;
  }
}
origin: jsettlers/settlers-remake

private void selectArea(SelectAreaAction action) {
  final SelectionSet selectionSet = new SelectionSet();
  action.getArea().stream().filterBounds(grid.getWidth(), grid.getHeight()).forEach((x, y) -> {
    final IGuiMovable movable = grid.getMovable(x, y);
    if (movable != null && canSelectPlayer(movable.getPlayer().getPlayerId())) {
      selectionSet.add(movable);
    }
    final IBuilding building = grid.getBuildingAt(x, y);
    if (building != null && canSelectPlayer(building.getPlayer().getPlayerId())) {
      selectionSet.add(building);
    }
  });
  setSelection(selectionSet);
}
jsettlers.common.actionSelectAreaAction

Javadoc

This class hold special information for the action type EActionType#SELECT_AREA.

Most used methods

  • <init>
    Creates a new select area action.
  • getArea
    Gets the selected area.

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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