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)
    • addTile

      public boolean addTile(Tile tile)
    • addGate

      public boolean addGate(Gate gate)
    • removeTile

      public boolean removeTile(Tile tile)
    • containsTile

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

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

      public boolean removeGate(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