Woyo::World is a singleton DSL: world do # some states may be mutually exclusive # setting one will undo others states do exclusive :dark, :dim, :light, :bright exclusive :cold, :cool, :warm, :hot end # locations are places a player can be location :name do # name is a symbol # default title is name.to_s.capitalize title "...." # default description description "........." description do # may depend on verbose game setting long "........." short "...." # may depend on location state ? is :bright, "........." is :cold, "........." end # concise hash / named parameters ? description long: "...................", short: "...." # locations do NOT contain locations # locations are a graph, linked by ways # ways lead to/from other locations # standard ways map to directions and movements # north,south,east,west,up,down,forward,back,left,right way north:, "location name" ways do east :far_east west :wild_west up :sky down :pit end # 'is' a set of multiple states # default: nil # symbols or strings is :cold, :dark is "bright", "hot" # in code: is? :cold / is_cold? like rspec ? # here == self ? end # items are things that may be in a location item "name" do # short description used when seen description "....." # longer description when examined detail "....." # have aspects aspect :small, :light # may be at a location location "location name" # this == self ? end # concise hash item "name", description: "...", detail: "...", aspect: [ :small, :light ] # items can relate to other items ?.... # contains / contained # before / behind # on / under # above / below # near / far # module for this 'Relation' feature ? end # code can be instance(?) eval'd when defining world, location, items # code for ... triggers, events, handlers, conditions, etc... # can locations, items be subclassed ? # then defined in DSL ? item :vase do description "a vase" aspect :small, :light end vase :blue_vase do aspect :blue end vase :red_vase do aspect :red end # is this more like prototyping than subclassing ?