EntryPortal : Enterable
[Previous] [Main] [Next]

An EntryPortal is just like an Enterable, except that you can go through it as well as enter it. It can be used, for example, for an archway that is plainly the entrance to another destination:

mainCave: Room 'Large Cave'
    "This is the main cave. A large rock rests against the north wall and
     there is another cave to the south and an archway to the east,
     <<boulder.moved ? 'and a passage 
     has been opened up to the west' : 'but the way west is blocked by
     a huge boulder'>>. A blazing torch is fixed to the wall, next to a sturdy 
     steel ladder leading upwards. "
    north = rock
    south = anotherCave
    west : OneWayRoomConnector
        {
          ->roundCave
           canTravelerPass (traveler) { return boulder.moved; }
           explainTravelBarrier (traveler) 
            { "The huge boulder is in the way. "; }

        }    
    east = squareCave
    up = upLadder
;


+ EntryPortal ->squareCave 'arch/archway' 'archway'
  "It's a large archway, leading to another cave beyond. "
;

The property pointed to by -> in the template is actually the connector traversed, not the destination reached, when the EntryPortal is entered, although when, as here, the connector is a Room this has the same effect (see this discussion of the distinction in connection with the Enterable class, from which EntryPortal inherits). Entry portal inherits from Enterable and hence inherits the Enterable template.