Class: Inform::Runtime

Inherits:
Object show all
Extended by:
Library::ClassMethods, RuntimeClassMethods
Includes:
Game::Loader, IO, Library::Loader, Publisher, RuntimeConstants, RuntimeInstanceMethods
Defined in:
lib/runtime/runtime.rb

Overview

The Runtime class loads a game and plays it in a REPL session.

Constant Summary

Constants included from Library::ClassMethods

Library::ClassMethods::InclusionGrammarGuessTemplate, Library::ClassMethods::InclusionGuessesTemplate, Library::ClassMethods::PropertyModifiers

Constants included from Subscribers

Subscribers::REGISTRY

Constants included from IO

IO::ItemPaddingString, IO::MinimumCellPadding, IO::MinimumColumnPadding, IO::MinimumLineLength

Constants included from Game::Loader

Game::Loader::EnsureFirst, Game::Loader::GrammarParsedInfoMessage

Constants included from RuntimeConstants

Inform::RuntimeConstants::LibraryRegistry, Inform::RuntimeConstants::Registry, Inform::RuntimeConstants::UndefinedMainPattern

Instance Attribute Summary

Attributes included from RuntimeInstanceMethods

#main_object

Instance Method Summary collapse

Methods included from Library::ClassMethods

Attribute, Constant, Default, Include, Link, Property, declare_property, import_global, require_first_existing

Methods included from RuntimeClassMethods

database_saves_dir_path, default_config, default_environment, default_game_dir_path, inform_dir_path, init, instance, invocation_context, invocation_properties, language_name, lib_dir_path, libraries, main_gem_spec_executable, player?, project_dir_path, support_dir_path

Methods included from Publisher

#muted?, #publish, #publish_except, #publish_only, #publish_system_message, #subscribers

Methods included from Subscribers

#explicit_subscribers, #subscribe, #subscribers, #unsubscribe, #unsubscribe_all

Methods included from IO

#connections, #flush_io, #inform, #many_per_line, #new_line, #noop, #out, #output_stream, #print, #println, #prompt, #read, #reset_prompt, #session, #spaces, #tidy_output

Methods included from Library::Loader

#load_library, #overrides

Methods included from Game::Loader

#first_orphan_object_with_description_that_has_light, #grammar_files, #handle_load_failure, #load_game, #load_game_files, #load_game_states, #load_game_sub, #load_game_subcomponents, #load_grammars, #load_path=, #prioritize_if, #reload_game, #reset_constants

Methods included from RuntimeInstanceMethods

#apply_preferences, #config_file_path, #ensure_location, #game_components, #game_dir_name, #game_path, #grammar_module_path, #inform_library, #inspect, #invocation_context, #invocation_properties, #invoke_main_method, #manage_inform_library, #manage_privileges, #play_game, #quit, #read_eval_print_loop, #to_s

Constructor Details

#initialize(options = Inform::Runtime.default_config) ⇒ Runtime

Returns a new instance of Runtime.



294
295
296
297
298
299
# File 'lib/runtime/runtime.rb', line 294

def initialize(options = Inform::Runtime.default_config)
  @options = options
  Inform::Game.init(@options)
  Inform::Context.set(invocation_context)
  Inform.initialize_persistence_layer
end