Class Connectable.Utils
java.lang.Object
group24.escaperoom.entities.properties.Connectable.Utils
- Enclosing interface:
- Connectable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<Connectable.ConnectableItem>connectableAt(Types.IntVector2 pos, MapScreen screen, Connector.ConnectorType type) static Optional<Connectable.ConnectableItem>static Optional<Connectable.ConnectableItem>matches(Item i, Connector.ConnectorType connectorType) static voidmaybeUpateSurroundingTileables(Item justPlaced, MapScreen screen) Connectable items (even those that are not tileable) need to influence the textures of surrounding tileable items.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
isConnectable
-
matches
public static Optional<Connectable.ConnectableItem> matches(Item i, Connector.ConnectorType connectorType) - Parameters:
i- An item to inspectconnectorType- the type of connector we are interested in
-
connectableAt
public static Optional<Connectable.ConnectableItem> connectableAt(Types.IntVector2 pos, MapScreen screen, Connector.ConnectorType type) - Parameters:
pos- A position to inspectscreen- ref to the current maptype- the type of connector we are interested in finding
-
maybeUpateSurroundingTileables
Connectable items (even those that are not tileable) need to influence the textures of surrounding tileable items. This function takes an item that was just placed, and updates any tileable connectable items that surround this item. Note that this will do nothing for already tileable connectable items, as their update logic is handled on placement (either in game with theGameScreenDragAndDrop or in the level editor inDragManager
-