Class Chest
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPObject
games.stendhal.server.entity.Entity
games.stendhal.server.entity.mapstuff.chest.Chest
- All Implemented Interfaces:
UseListener
,Killer
,Cloneable
,Iterable<String>
,Serializable
- Direct Known Subclasses:
NPCOwnedChest
,PersonalChest
,StoredChest
A chest is an unmovable container. It can be opened and closed. While it is
open, every player can put items in and take them out later. A player can
take out items that another player put in.
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID
-
Field Summary
Fields inherited from class marauroa.common.game.RPObject
INVALID_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add(PassiveEntity entity)
Adds a passive entity (like an item) to the chest.void
close()
Close the chest.describe()
Describes the entity (if a players looks at it).static void
Returns the content.getDescriptionName(boolean definite)
Returns the name or something that can be used to identify the entity for the player.boolean
isOpen()
Determine if the chest is open.boolean
Invoked when the object is used.void
open()
Open the chest.int
size()
Returns the number of attributes and events this object is made of.void
update()
Methods inherited from class games.stendhal.server.entity.Entity
getAdjacentNodes, getArea, getArea, getCursor, getDescription, getEntitySlot, getHeight, getName, getOrigin, getResistance, getResistance, getTitle, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, onAdded, onMoved, onRemoved, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stopped
Methods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isHidden, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJson
Methods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlots
Methods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Chest
public Chest()Creates a new chest. -
Chest
Creates a new chest.- Parameters:
object
- RPObject
-
-
Method Details
-
generateRPClass
public static void generateRPClass() -
getDescriptionName
Description copied from class:Entity
Returns the name or something that can be used to identify the entity for the player.- Overrides:
getDescriptionName
in classEntity
- Parameters:
definite
- true for "the" and false for "a/an" in case the entity has no name- Returns:
- name
-
update
public void update() -
open
public void open()Open the chest. -
close
public void close()Close the chest. -
isOpen
public boolean isOpen()Determine if the chest is open.- Returns:
true
if the chest is open.
-
add
Adds a passive entity (like an item) to the chest.- Parameters:
entity
- entity to add
-
size
public int size()Description copied from class:RPObject
Returns the number of attributes and events this object is made of. -
getContent
Returns the content.- Returns:
- iterator for the content
-
onUsed
Description copied from interface:UseListener
Invoked when the object is used.- Specified by:
onUsed
in interfaceUseListener
- Parameters:
user
- the RPEntity who uses the object- Returns:
- true if successful
-
describe
Description copied from class:Entity
Describes the entity (if a players looks at it).
-