Class Connectable.Utils

java.lang.Object
group24.escaperoom.entities.properties.Connectable.Utils
Enclosing interface:
Connectable

public static final class Connectable.Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • isConnectable

      public static Optional<Connectable.ConnectableItem> isConnectable(Item i)
    • matches

      public static Optional<Connectable.ConnectableItem> matches(Item i, Connector.ConnectorType connectorType)
      Parameters:
      i - An item to inspect
      connectorType - 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 inspect
      screen - ref to the current map
      type - the type of connector we are interested in finding
    • maybeUpateSurroundingTileables

      public static void maybeUpateSurroundingTileables(Item justPlaced, MapScreen screen)
      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 the GameScreen DragAndDrop or in the level editor in DragManager