public synchronized Interactable getInteractableAt ( TerminalPosition position ) { if ( position . getRow ( ) < 0 || position . getColumn ( ) < 0 ) { return null ; } if ( position . getRow ( ) >= lookupMap . length ) { return null ; } else if ( position . getColumn ( ) >= lookupMap [ 0 ] . length ) { return null ; } else if ( lookupMap [ position . getRow ( ) ] [ position . getColumn ( ) ] == - 1 ) { return null ; } return interactables . get ( lookupMap [ position . getRow ( ) ] [ position . getColumn ( ) ] ) ; }
Looks up what interactable component is as a particular location in the map