Class Exit
In: lib/core/exit.rb
Parent: GameObject
Exit
GameObject
dot/f_11.png

The Exit class is the mother of all exits.

Methods

leave   new  

Public Class methods

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.

[Source]

# 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

Event :leave

e
The event
return
Undefined

[Source]

# 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

[Validate]