Interface Interactable
- All Known Implementing Classes:
AreaBehavior.Cell,AreaEntity,CellMouseIndicator,CollectableAreaEntity,DraggableAreaEntity,MovableAreaEntity
public interface Interactable
Represent Interactable object (i.e. Interactor can interact with it)
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptInteraction(AreaInteractionVisitor v, boolean isCellInteraction) Call directly the interaction on this if acceptedGet this Interactor's current occupying cells coordinatesbooleanbooleanvoidonEntering(List<DiscreteCoordinates> coordinates) Called when this Interactable enters a cellvoidonLeaving(List<DiscreteCoordinates> coordinates) Called when this Interactable leaves a cellbooleanIndicate if the current Interactable take the whole cell space or not i.e.
-
Method Details
-
getCurrentCells
List<DiscreteCoordinates> getCurrentCells()Get this Interactor's current occupying cells coordinates- Returns:
- (List of DiscreteCoordinates). May be empty but not null
-
takeCellSpace
boolean takeCellSpace()Indicate if the current Interactable take the whole cell space or not i.e. only one Interactable which takeCellSpace can be in a cell (how many Interactable which don't takeCellSpace can also be in the same cell)- Returns:
- (boolean)
-
isCellInteractable
boolean isCellInteractable()- Returns:
- (boolean): true if this is able to have cell interactions
-
isViewInteractable
boolean isViewInteractable()- Returns:
- (boolean): true if this is able to have view interactions
-
acceptInteraction
Call directly the interaction on this if accepted- Parameters:
v- (AreaInteractionVisitor) : the visitor
-
onLeaving
Called when this Interactable leaves a cell- Parameters:
coordinates- left cell coordinates
-
onEntering
Called when this Interactable enters a cell- Parameters:
coordinates- entered cell coordinates
-