# TODO: JSON support is currently experimental. #require 'gamefic/entityloader' require 'gamefic/tester' require 'gamefic/source' require 'gamefic/script' require 'gamefic/query' module Gamefic class Plot autoload :Scenes, 'gamefic/plot/scenes' autoload :Commands, 'gamefic/plot/commands' autoload :Entities, 'gamefic/plot/entities' autoload :Articles, 'gamefic/plot/articles' autoload :YouMount, 'gamefic/plot/you_mount' autoload :Snapshot, 'gamefic/plot/snapshot' autoload :Host, 'gamefic/plot/host' autoload :Players, 'gamefic/plot/players' autoload :Playbook, 'gamefic/plot/playbook' autoload :Callbacks, 'gamefic/plot/callbacks' autoload :Theater, 'gamefic/plot/theater' attr_reader :commands, :imported_scripts, :source # TODO: Metadata could use better protection attr_accessor :metadata include Theater include Gamefic, Tester, Players, Scenes, Commands, Entities include Articles, YouMount, Snapshot, Host, Callbacks # @param source [Source::Base] def initialize(source = nil) @source = source || Source::Text.new({}) @working_scripts = [] @imported_scripts = [] @running = false post_initialize end # @return [Gamefic::Plot::Playbook] def playbook @playbook ||= Gamefic::Plot::Playbook.new end def running? @running end # Get an Array of all scripts that have been imported into the Plot. # # @return [Array