java.lang.Object
com.googlecode.lanterna.gui2.InteractableLookupMap
This class is used to keep a 'map' of the usable area and note where all the interact:ables are. It can then be used
to find the next interactable in any direction. It is used inside the GUI system to drive arrow key navigation.
- Author:
- Martin
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Interactable interactable) Adds an interactable component to the lookup mapfindNextDown(Interactable interactable) Starting from a particularInteractableand going down, which is the next interactable?findNextLeft(Interactable interactable) Starting from a particularInteractableand going left, which is the next interactable?findNextRight(Interactable interactable) Starting from a particularInteractableand going right, which is the next interactable?findNextUp(Interactable interactable) Starting from a particularInteractableand going up, which is the next interactable?getInteractableAt(TerminalPosition position) Looks up what interactable component is as a particular location in the map
-
Method Details
-
add
Adds an interactable component to the lookup map- Parameters:
interactable- Interactable to add to the lookup map
-
getInteractableAt
Looks up what interactable component is as a particular location in the map- Parameters:
position- Position to look up- Returns:
- The
Interactablecomponent at the specified location ornullif there's nothing there
-
findNextUp
Starting from a particularInteractableand going up, which is the next interactable?- Parameters:
interactable- WhatInteractableto start searching from- Returns:
- The next
Interactableabove the one specified ornullif there are no moreInteractable:s above it
-
findNextDown
Starting from a particularInteractableand going down, which is the next interactable?- Parameters:
interactable- WhatInteractableto start searching from- Returns:
- The next
Interactablebelow the one specified ornullif there are no moreInteractable:s below it
-
findNextLeft
Starting from a particularInteractableand going left, which is the next interactable?- Parameters:
interactable- WhatInteractableto start searching from- Returns:
- The next
Interactableleft of the one specified ornullif there are no moreInteractable:s left of it
-
findNextRight
Starting from a particularInteractableand going right, which is the next interactable?- Parameters:
interactable- WhatInteractableto start searching from- Returns:
- The next
Interactableright of the one specified ornullif there are no moreInteractable:s right of it
-