Package org.kikikan.deadbymoonlight.game
Class Chest
- java.lang.Object
-
- org.kikikan.deadbymoonlight.game.WorldObject
-
- org.kikikan.deadbymoonlight.game.Chest
-
public final class Chest extends WorldObject
Represents a Chest.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItem(Item item)
Overwrites the Item in the Chest with the provided Item.boolean
getCanBeSearched()
Checks if the Chest can be searched.Item
getItem()
Gets the Item that is in this Chest.boolean
isOpen()
Checks if the Chest is open.Item
removeItem()
Removes and returns the Item in the Chest.-
Methods inherited from class org.kikikan.deadbymoonlight.game.WorldObject
equals, getGame, getLocation, hashCode
-
-
-
-
Method Detail
-
isOpen
public boolean isOpen()
Checks if the Chest is open.- Returns:
- True if another Survivor is using this Chest.
-
addItem
public void addItem(Item item)
Overwrites the Item in the Chest with the provided Item.- Parameters:
item
- The Item that will override the one in the Chest.
-
getItem
public Item getItem()
Gets the Item that is in this Chest. Can be null.- Returns:
- The Item this Chest holds.
-
removeItem
public Item removeItem()
Removes and returns the Item in the Chest.- Returns:
- The Item that is now no longer in the Chest.
-
getCanBeSearched
public boolean getCanBeSearched()
Checks if the Chest can be searched.- Returns:
- True if an Item was not generated in this Chest yet.
-
-