Package com.mg105.interface_adapters.map
Class RoomInterpreter
java.lang.Object
com.mg105.interface_adapters.map.RoomInterpreter
- All Implemented Interfaces:
RoomInterpreterInterface
RoomInterpreter interprets the current room in a format that is easier to draw from.
-
Constructor Summary
ConstructorDescriptionRoomInterpreter
(@NotNull RoomGetterInterface getter) Create a new RoomInterpreter that will get its information from getter. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
Retrieves the sprite String currently associated with the WalkingCharacter.RoomTileType[][]
Get the current room as represented in an easier to draw grid.@NotNull Point
Get the current player position in the room.
-
Constructor Details
-
RoomInterpreter
Create a new RoomInterpreter that will get its information from getter.- Parameters:
getter
- the information source for the RoomInterpreter.
-
-
Method Details
-
getCurrentRoom
Get the current room as represented in an easier to draw grid.- Specified by:
getCurrentRoom
in interfaceRoomInterpreterInterface
- Returns:
- the room as a 2 dimension array of TileType representing the current state of the room. Note that (0, 0) represents the top-left corner and (MapConstants.ROOM_SIZE, MapConstants.ROOM_SIZE) represents the bottom right corner.
-
getPlayer
Get the current player position in the room.- Specified by:
getPlayer
in interfaceRoomInterpreterInterface
- Returns:
- the current player position in the room.
-
getCharacterSprite
Retrieves the sprite String currently associated with the WalkingCharacter.- Specified by:
getCharacterSprite
in interfaceRoomInterpreterInterface
- Returns:
- a file name/location as a String for the desired character sprite.
-