indexing description: "[ A EM_GOOF_LOADER level xml file, to read a EM_GOOF_LOADER level from. ]" date: "$Date$" revision: "$Revision$" class EM_GOOF_LOADER_LEVEL_FILE inherit KL_SHARED_FILE_SYSTEM export {NONE} all end EXCEPTIONS export {NONE} all end create make_from_file feature {NONE} -- Initialization make_from_file (a_filename: STRING) is -- Initialize with level loaded from file with `a_filename'. -- (either `a_filename' is an absolute path -- or relative to current working directory) require a_filename_not_empty: a_filename /= Void and then not a_filename.is_empty file_with_a_filename_exists: File_system.file_exists (a_filename) local factory: EM_GOOF_LOADER_LEVEL_FACTORY level_parser: EM_GOOF_LOADER_LEVEL_PARSER adaptor: EM_GOOF_LOADER_XML_ADAPTOR execution_environment: EXECUTION_ENVIRONMENT do filename := a_filename create factory.make create level_parser.make_with_factory (factory) create adaptor adaptor.adapt_xml_registry (level_parser) level_parser.set_file_name (a_filename) create execution_environment level_parser.parse if level_parser.can_process then level_parser.process end if level_parser.has_error then io.put_string ( level_parser.error_description) raise ("Error while parsing " + a_filename + ": " + level_parser.error_description) else goof_level := factory.level end ensure goof_level_loaded: goof_level /= Void end feature -- Access filename: STRING -- Filename goof_level: EM_GOOF_PHYSICS -- Map in `Current'. invariant filename_not_empty: filename /= Void and then not filename.is_empty goof_level_not_void: goof_level /= Void end