NearbyAttachableclass | extras.t[3311] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
In AttachTo actions, we enforce the nearby requirement with a precondition requiring the direct object to be in the same immediate container as the indirect object, and vice versa. In moveWhileAttached(), we enforce the rule by detaching the objects if one is being moved away from the other's immediate container.
class
NearbyAttachable : Attachable
NearbyAttachable
Attachable
object
Inherited from Attachable
:
attachedObjects
attachmentLister
majorAttachmentLister
dobjFor(AttachTo)
getNearbyAttachmentLocs
iobjFor(AttachTo)
moveWhileAttached
nestedDetachFrom
Inherited from Attachable
:
attachTo
beforeTravel
canAttachTo
canDetachFrom
cannotDetachMsgFor
detachFrom
dobjFor(Detach)
dobjFor(DetachFrom)
dobjFor(TakeFrom)
examineStatus
explainCannotAttachTo
getNonPermanentAttachments
handleAttach
handleDetach
initializeThing
iobjFor(DetachFrom)
iobjFor(TakeFrom)
isAttachedTo
isListedAsAttachedTo
isListedAsMajorFor
isMajorItemFor
isPermanentlyAttachedTo
mainMoveInto
maybeHandleAttach
maybeHandleDetach
travelWhileAttached
dobjFor(AttachTo) OVERRIDDEN | extras.t[3312] |
getNearbyAttachmentLocs (other) | extras.t[3347] |
This method returns a list with three elements. The first element is the target location for 'self', and the second is the target location for 'other', the object we're attaching to. The third element is an integer giving the priority; a higher number means higher priority.
The priority is an arbitrary value that we use to determine which of the two objects involved in the attach gets to decide on the target locations. We call this method on both of the two objects being attached to one another, then we use the target locations returned by the object that claims the higher priority. If the two priorities are equal, we pick one arbitrarily.
The default implementation chooses my own immediate container as the target location for both objects. However, if the other object is non-portable, we'll choose its immediate location instead, since we obviously can't move it to our container.
iobjFor(AttachTo) OVERRIDDEN | extras.t[3317] |
moveWhileAttached (movedObj, newCont) OVERRIDDEN | extras.t[3373] |
nestedDetachFrom (obj) | extras.t[3404] |