Class Door
- All Implemented Interfaces:
TurnListener,UseListener,Killer,Cloneable,Iterable<String>,Serializable
- Direct Known Subclasses:
LockedDoor,OnePlayerRoomDoor
A door is a special kind of portal which can be open or closed.
Note that you can link a door with a portal; that way, people only require
the key when walking in one direction and can walk in the other direction
without any key.
-
Nested Class Summary
Nested classes/interfaces inherited from class games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal
AccessCheckingPortal.SendMessageNested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
Fields inherited from class games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal
forceStop, instantAction, listeningRadius, passwordAcceptedMessage, passwordRejectedMessage, portalID, portalIDCounter, rejectedAction, rejectedMessage, requiredPasswordFields inherited from class games.stendhal.server.entity.mapstuff.portal.Portal
ATTR_FACE, ATTR_HIDDEN, ATTR_OFFSET, ATTR_USEFields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclose()Closes the door.describe()Describes the entity (if a players looks at it).static voidprotected booleanisOpen()Is the door open?voidonTurnReached(int currentTurn) This method is called when the turn number is reached.booleanTeleport (if the door is now open).voidonUsedBackwards(RPEntity user, boolean hadPath) If this portal is the destination of another portal used.voidopen()Opens the door.voidupdate()Methods inherited from class games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal
getListeningRadius, getPasswordAcceptedMessage, getPasswordRejectedMessage, getRejectedMessage, getRequiredPassword, hasInstanceAction, isAllowed, logic, playerIsPortalUnlocked, rejected, sendMessage, setForceStop, setInstantAction, setListeningRadius, setPasswordAcceptedMessage, setPasswordRejectedMessage, setRejectedAction, setRejectedMessage, setRequiredPasswordMethods inherited from class games.stendhal.server.entity.mapstuff.portal.Portal
getDestinationReference, getDestinationZone, getFaceDirection, getIdentifier, getOffset, hasFaceDirection, hasOffset, isHidden, loaded, onPushedOntoFrom, setDestination, setFaceDirection, setFaceDirection, setHidden, setIdentifier, setIgnoreNoDestination, toString, usePortalMethods inherited from class games.stendhal.server.entity.Entity
getAdjacentNodes, getArea, getArea, getCursor, getDescription, getDescriptionName, 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, stoppedMethods 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, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, size, slots, slotsIterator, store, unhide, unstore, writeObject, writeObject, writeToJsonMethods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlotsMethods 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, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Door
Creates a new door.- Parameters:
clazz- The class. Responsible for how this door looks like.
-
Door
Creates a new door.- Parameters:
clazz- The class. Responsible for how this door looks like.rejectMessage- The message to given when rejected.
-
-
Method Details
-
generateRPClass
public static void generateRPClass() -
update
public void update() -
open
public void open()Opens the door. -
close
protected void close()Closes the door. -
isOpen
protected boolean isOpen()Is the door open?- Returns:
- true, if opened; false otherwise
-
onUsed
Teleport (if the door is now open).- Specified by:
onUsedin interfaceUseListener- Overrides:
onUsedin classAccessCheckingPortal- Parameters:
user- that wants to pass.- Returns:
- true if passed , false otherwise.
-
onUsedBackwards
Description copied from class:PortalIf this portal is the destination of another portal used.- Overrides:
onUsedBackwardsin classPortal- Parameters:
user- the player who used the other portal teleporting to ushadPath- determines if entity was using mouse click to use portal
-
describe
Description copied from class:EntityDescribes the entity (if a players looks at it). -
onTurnReached
public void onTurnReached(int currentTurn) Description copied from interface:TurnListenerThis method is called when the turn number is reached.- Specified by:
onTurnReachedin interfaceTurnListener- Parameters:
currentTurn- current turn number
-