summaryrefslogtreecommitdiffstats
path: root/lib/evendoors/room.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/evendoors/room.rb')
-rw-r--r--lib/evendoors/room.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb
index d06c00f..eaa8ace 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -42,6 +42,19 @@ module EvenDoors
@spin = ( @parent.nil? ? self : @parent.spin )
end
#
+ def resolve search
+ return self if search==path
+ if (search=~/^#{path}\/(\w+)\/?/)==0
+ if spot = @spots[$1]
+ return spot if spot.path==search # needed as Door doesn't implement #resolve
+ return spot.resolve search
+ else
+ nil
+ end
+ end
+ (@parent ? @parent.resolve(search) : nil )
+ end
+ #
def try_links p
puts " -> try_links ..." if EvenDoors::Spin.debug_routing
links = @links[p.src.name]