class Exit

The Exit class is the mother of all exits.

Public Class Methods

new(name, owner, location, to_room) click to toggle source

Create a new Exit object

name

The displayed name of the room

owner

The owner id of this room

return

A handle to the new Room.

# File lib/core/exit.rb, line 27
def initialize(name, owner, location, to_room)
  super(name, owner, location)
  self.to_room=to_room    # The room the exit leads to
                          # location is the room the exit starts in
end

Public Instance Methods

leave(e) click to toggle source

Event :leave

e

The event

return

Undefined

# File lib/core/exit.rb, line 36
def leave(e)
  ch = get_object(e.from)
  characters(e.from).each do |x|
    add_event(location, x.id,:show, ch.name + " has left #{e.msg}.") if x.account
  end
  # remove character
  get_object(location).delete_contents(ch.id)
  ch.location = nil
  add_event(id, to_room, :arrive, ch.id)
end