Class RoomGetter

java.lang.Object
com.mg105.use_cases.map.RoomGetter
All Implemented Interfaces:
RoomGetterInterface

public class RoomGetter extends Object implements RoomGetterInterface
RoomGetter is responsible for getting the state current room.
  • Constructor Details

    • RoomGetter

      public RoomGetter(@NotNull @NotNull GameState state)
      Create a new RoomGetter for a given sate.
      Parameters:
      state - the game state that this room getter operates on.
  • Method Details

    • getCurrentRoomLayout

      @NotNull public @NotNull RoomLayout getCurrentRoomLayout()
      Get the current room.

      By definition this only gets the environment of the room.

      Specified by:
      getCurrentRoomLayout in interface RoomGetterInterface
      Returns:
      the current room.
    • getWalkingSprite

      @NotNull public @NotNull String getWalkingSprite()
      Retrieves the WalkingCharacter sprite name String, returns a file name/location corresponding to the name.
      Specified by:
      getWalkingSprite in interface RoomGetterInterface
      Returns:
      a String representing the file name/location for the selected character sprite.
    • isFinalRoom

      public boolean isFinalRoom()
      Checks if the player is in the final room
      Specified by:
      isFinalRoom in interface RoomGetterInterface
      Returns:
      whether the player is in the final room