The purpose of a ContainerDoor is to represent the door of a Container, when the player might want to refer to it separately. A container's door cannot be straightforwardly made a component of its container (located in the container), since this would have the effect of putting the door inside the container, where it would vanish out of sight when the container was closed. You would therefore normally use a ContainerDoor as a component of (located in) a ComplexContainer; it then maps OPEN, CLOSE, LOCK, UNLOCK, LOOK IN and LOOK BEHIND commands to the subContainer of that ComplexContainer.
For example, the dressing table we've just defined mentions in its description that it has a pair of doors. To implement those doors we just need to define the following, immediately after the definition of the dressing table ComplexContainer object:
+ ContainerDoor '(dressing) (table) door/pair/doors' 'dressing table door'
"They're made of the same scratched, stained wood as the dressing table
to which they're attached, and perfectly match its generally battered
isPlural = true
It's also possible to set up a ContainerDoor to act as the door to any kind of openable container, by setting its subContainer property to point to that container. For example, we could add a door to the locker in the crew quarters by this means:
locker : LockableContainer, Fixture '(crew) locker' 'locker' @crewQuarters
"The locker is fixed firmly to the bulkhead. Its door is fastened by a simple
latch mechanism, though the latch looks a bit rusty. "
bulkCapacity = 15
disambigName = 'crew locker'
initiallyLocked = true
reportFailure('The latch is stuck fast. ');