indexing description: "[ An EM_GOOF_LOADER_NODE_PROCESSOR to load the EM_GOOF_OBSTACLE from xml file. ]" date: "$Date$" revision: "$Revision$" class EM_GOOF_LOADER_OBJECT_OBSTACLE_NODE_PROCESSOR inherit EM_GOOF_LOADER_OBJECT_SIMPLE_NODE_PROCESSOR undefine make end EM_GOOF_LOADER_OBJECT_COLLIDABLE_NODE_PROCESSOR undefine make end create make feature -- Initialization make is -- Make 'Current' do Precursor Current.register_allowed_subnode ("object", name) end feature -- Access Name: STRING is -- Name of element to process do Result := "obstacle" end Mandatory_attributes: ARRAY [STRING] is -- Table of mandatory attributes once Result := << "image" >> Result := << "x" >> Result := << "y" >> Result.compare_objects end feature -- Basic operations process is -- Process node. local obstacle: EM_GOOF_OBSTACLE do if not has_attribute ("image") then set_error (Mandatory_attribute_missing, << "image" >>) elseif not has_attribute ("x") then set_error (Mandatory_attribute_missing, << "x" >>) elseif not has_attribute ("y") then set_error (Mandatory_attribute_missing, << "y" >>) elseif not attribute("x").is_double then set_error (Non_numeric_argument, << "x" >>) elseif not attribute("y").is_double then set_error (Non_numeric_argument, << "y" >>) else create obstacle.premake load_image(obstacle) if parent.container /= void then parent.container.add_item(obstacle) else level.add_object(obstacle) end if has_attribute ("name") then level.register_object(attribute("name"), obstacle) end load_collidable(obstacle) end end file: STRING -- String in which the filename is stored end