Package com.mg105.interface_adapters.map
Class MinimapInterpreter
java.lang.Object
com.mg105.interface_adapters.map.MinimapInterpreter
- All Implemented Interfaces:
MinimapInterpreterInterface
,Resetable
,PropertyChangeListener
,EventListener
public class MinimapInterpreter
extends Object
implements PropertyChangeListener, Resetable, MinimapInterpreterInterface
The MinimapInterpreter processes room change data an interprets its implicit position.
-
Constructor Summary
ConstructorDescriptionMinimapInterpreter
(@NotNull RoomGetterInterface getter) Create a new MinimapInterpreter. -
Method Summary
Modifier and TypeMethodDescription@NotNull Point
Get the current position in (x, y)-coordinates of the result of getMapSoFar.@NotNull MinimapRoomState[][]
Get the current explored map.void
Update room position data.void
reset()
Reset the minimap to its 'factory new' state.
-
Constructor Details
-
MinimapInterpreter
Create a new MinimapInterpreter.- Parameters:
getter
- the RoomGetter that will get room information.
-
-
Method Details
-
reset
public void reset()Reset the minimap to its 'factory new' state. -
propertyChange
Update room position data.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
evt
- A PropertyChangeEvent object describing the event source and the property that has changed.
-
getMapSoFar
Get the current explored map.- Specified by:
getMapSoFar
in interfaceMinimapInterpreterInterface
- Returns:
- the currently explored map.
- See Also:
-
getCurrentPosition
Get the current position in (x, y)-coordinates of the result of getMapSoFar.- Specified by:
getCurrentPosition
in interfaceMinimapInterpreterInterface
- Returns:
- the current room you are in.
- See Also:
-