lib/demiurge/dsl.rb
# Declare an agent in this location.
Declare an agent in this location.
Declare an agent in this location .
def agent(name, options = {}, &block)
      state = { "position" => @name, "zone" => @state["zone"], "home_zone" => @state["zone"] }
      builder = AgentBuilder.new(name, @engine, options.merge("state" => state) )
      builder.instance_eval(&block)
      @built_item.state["contents"] << name
      nil
    end
def agent ( name , options = { } , & block ) state = { "position" => @name , "zone" => @state [ "zone" ] , "home_zone" => @state [ "zone" ] } builder = AgentBuilder . new ( name , @engine , options . merge ( "state" => state ) ) builder . instance_eval ( & block ) @built_item . state [ "contents" ] << name nil end
Declare an agent in this location.
Declare an agent in this location .
name
options
block