Class Room


public class Room extends StoryNode
  • Constructor Details

    • Room

      public Room(String name, String description)
      Constructor
      Parameters:
      name - Name of the room
      description - Description of the room
    • Room

      public Room(String name, String description, int ID)
      Constructor for deserialization
      Parameters:
      name - Name of the room
      description - Description of the room
      ID - int ID of the class
  • Method Details

    • getName

      public String getName()
      Name getter
      Returns:
      String name of the room
    • getDescription

      public String getDescription()
      Description getter
      Returns:
      String description of the room
    • getItems

      public List<Item> getItems()
      Items list getter
      Returns:
      List of all items in the room
    • getBackgroundPath

      public String getBackgroundPath()
      Background path getter.
      Returns:
      Background path relative to resources.com.adventure.
    • getMonster

      public Enemy getMonster()
      Monster getter
      Returns:
      Monster inside the room
    • getCompleted

      public boolean getCompleted()
      Completed getter.
      Returns:
      True if the room is completed, false otherwise.
    • setName

      public void setName(String name)
      Name setter
      Parameters:
      name - name of the room
    • setDescription

      public void setDescription(String description)
      Description setter
      Parameters:
      description - description of the room
    • setItems

      public void setItems(List<Item> items)
      Items list setter
      Parameters:
      items - List of items to place in the room
    • setBackgroundPath

      public void setBackgroundPath(String backgroundPath)
      Background path setter.
      Parameters:
      backgroundPath - Background path relative to resources.com.adventure.
    • setMonster

      public void setMonster(Enemy monster)
      Monster setter
      Parameters:
      monster - Monster to set
    • setCompleted

      public void setCompleted(boolean completed)
      Completed setter.
      Parameters:
      completed - Sets if the room is completed.
    • removeItem

      public Item removeItem(Item item)
      Remove an item from the room
      Parameters:
      item - Item to be removed
      Returns:
      The removed item.
    • toString

      public String toString()
      To string method
      Overrides:
      toString in class Object
      Returns:
      name, description, number of items