indexing description: "[ An EM_GOOF_LOADER_NODE_PROCESSOR to load the EM_GOOF_XY_VEHICLE from xml file. ]" date: "$Date$" revision: "$Revision$" class EM_GOOF_LOADER_OBJECT_XY_VEHICLE_NODE_PROCESSOR inherit EM_GOOF_LOADER_OBJECT_ROTATABLE_NODE_PROCESSOR undefine make end EM_GOOF_LOADER_OBJECT_COLLIDABLE_NODE_PROCESSOR undefine make end EM_GOOF_LOADER_OBJECT_PHYSICABLE_NODE_PROCESSOR undefine make end create make feature -- Initialization make is -- Make 'Current' do Precursor Current.register_allowed_subnode ("xy", name) end feature -- Access Name: STRING is -- Name of element to process do Result := "vehicle" 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 vehicle: EM_GOOF_XY_VEHICLE 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 vehicle.premake load_images(vehicle) if parent.container /= void then parent.container.add_item(vehicle) else level.add_object(vehicle) end load_vehicle(vehicle) load_physicable(vehicle) load_name(vehicle) load_collidable(vehicle) end end load_vehicle(vehicle: EM_GOOF_XY_VEHICLE) is -- Load vehicle do if has_attribute ("rect_friction") then if attribute("rect_friction").is_double then vehicle.set_rect_friction(attribute("rect_friction").to_double) else set_error (Non_numeric_argument, << "rect_friction" >>) end end if has_attribute ("propulsion") then if attribute("propulsion").is_double then vehicle.set_propulsion(attribute("propulsion").to_double) else set_error (Non_numeric_argument, << "propulsion" >>) end end if has_attribute ("rudder") then if attribute("rudder").is_double then vehicle.set_rudder(attribute("rudder").to_double) else set_error (Non_numeric_argument, << "rudder" >>) end end end file: STRING -- String in which the filename is stored end