Class Selection
java.lang.Object
com.prineside.tdi2.utils.mapeditor.Selection
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
void
clear()
boolean
boolean
int
count()
cpy()
void
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float scaleX, float scaleY, Map map) void
drawOutline
(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float scaleX, float scaleY, com.badlogic.gdx.graphics.Color color, com.badlogic.gdx.graphics.Color fillColor) 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 selectedint
hash()
boolean
hasTileOn
(int x, int y) boolean
boolean
boolean
void
setFromInventory
(boolean fromInventory) Sets the mode and clears selection if mode differstoString()
-
Field Details
-
tiles
-
gates
-
-
Constructor Details
-
Selection
public Selection()
-
-
Method Details
-
count
public int count() -
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
-
clear
public void clear() -
drawOutline
public void drawOutline(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float scaleX, float scaleY, com.badlogic.gdx.graphics.Color color, @Null com.badlogic.gdx.graphics.Color fillColor) -
draw
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float scaleX, float scaleY, Map map) -
addAll
-
add
-
add
-
remove
-
contains
- Returns:
- true if tile with the same stats is placed at the same coordinates
-
contains
- Returns:
- true if gate with the same stats is placed at the same coordinates
-
remove
-
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
-