Class Selection

java.lang.Object
com.prineside.tdi2.utils.mapeditor.Selection

public final class Selection extends Object
  • Field Details

  • Constructor Details

    • Selection

      public Selection()
  • Method Details

    • count

      public int count()
    • cpy

      public Selection cpy()
    • hash

      public int hash()
    • hasTileOn

      public boolean hasTileOn(int x, int y)
    • setFromInventory

      public void setFromInventory(boolean fromInventory)
      Sets the mode and clears selection if mode differs
    • isFromInventory

      public boolean isFromInventory()
    • dimensions

      public IntRectangle dimensions()
    • clear

      public void clear()
    • drawOutline

      public void drawOutline(Batch batch, float x, float y, float scaleX, float scaleY, Color color, @Null Color fillColor)
    • draw

      public void draw(Batch batch, float x, float y, float scaleX, float scaleY, Map map)
    • addAll

      public void addAll(Selection selection)
    • add

      public boolean add(Tile tile)
    • add

      public boolean add(Gate gate)
    • remove

      public boolean remove(Tile tile)
    • contains

      public boolean contains(Tile tile)
      Returns:
      true if tile with the same stats is placed at the same coordinates
    • contains

      public boolean contains(Gate gate)
      Returns:
      true if gate with the same stats is placed at the same coordinates
    • remove

      public boolean remove(Gate gate)
    • getCurrentItem

      public Item getCurrentItem()
      Creates an item from the selection At least one item must be selected (ideally exactly one) so check count() beforehand Throws exception when nothing is selected
      Returns:
      item wrapper for the selected gate/tile
    • toString

      public String toString()
      Overrides:
      toString in class Object