class Woyo::Server
Constants
- WORLD_FILES
Public Class Methods
eval_world(text, filename, world = nil)
click to toggle source
# File lib/woyo/server/server.rb, line 23 def self.eval_world text, filename, world = nil world ||= Woyo::World.new world.instance_eval text, filename end
load_world(glob = WORLD_FILES)
click to toggle source
# File lib/woyo/server/server.rb, line 15 def self.load_world glob = WORLD_FILES world = Woyo::World.new Dir[glob].each do |filename| eval_world File.read( filename ), filename, world end world end
Public Instance Methods
location()
click to toggle source
# File lib/woyo/server/server.rb, line 57 def location @location = world.locations[session[:location_id]] end
reload_world_changes()
click to toggle source
# File lib/woyo/server/server.rb, line 43 def reload_world_changes # todo: get and track file adds, deletes, mtimes in WORLD_FILES end
set_location(id)
click to toggle source
# File lib/woyo/server/server.rb, line 61 def set_location id session[:location_id] = id location end
world()
click to toggle source
# File lib/woyo/server/server.rb, line 53 def world @world = settings.world end