Package com.mg105.user_interface
Class MapDrawer
java.lang.Object
com.mg105.user_interface.MapDrawer
- All Implemented Interfaces:
Toggleable
,PropertyChangeListener
,EventListener
MapDrawer draws the map as a grid of tiles.
-
Constructor Summary
ConstructorDescriptionMapDrawer
(@NotNull RoomInterpreterInterface interpreter) Create an instance of MapDrawer. -
Method Summary
-
Constructor Details
-
MapDrawer
Create an instance of MapDrawer.- Parameters:
interpreter
- the room interpreter used to format the data in an acceptable way for this class.
-
-
Method Details
-
getScene
@NotNull public @NotNull javafx.scene.Scene getScene()Get the scene that will be used to draw to.- Specified by:
getScene
in interfaceToggleable
- Returns:
- the scene that the MapDrawer will draw to.
-
toggle
public void toggle(boolean isVisible) Toggle the visibility of map drawer. In this case we need to make sure the map drawing is up-to-date.- Specified by:
toggle
in interfaceToggleable
- Parameters:
isVisible
- true if the map is now visible, false otherwise.
-
updateRoom
public void updateRoom()Redraw the current room. This method only needs to be called if something has changed in the underlying current room. -
propertyChange
Update the current room based on evt.Note that none of the properties of evt are used.
- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
evt
- A PropertyChangeEvent object describing the event source and the property that has changed.
-