indexing description: "[ Goof loader object collidable node processor. ]" date: "$Date$" revision: "$Revision$" deferred class EM_GOOF_LOADER_OBJECT_COLLIDABLE_NODE_PROCESSOR inherit EM_GOOF_LOADER_NODE_PROCESSOR feature -- Loading load_collidable(object: EM_GOOF_COLLIDABLE) is -- Load collidable do if has_attribute ("collision_group") then if attribute("collision_group").is_integer then if has_attribute ("collision_type") then if attribute("collision_type").is_equal("rect") then if not has_attribute("collision_with") then set_error (Mandatory_attribute_missing, << "collision_with" >>) elseif not has_attribute("collision_height") then set_error (Mandatory_attribute_missing, << "collision_height" >>) elseif not attribute("collision_with").is_double then set_error (Non_numeric_argument, << "collision_with" >>) elseif not attribute("collision_height").is_double then set_error (Non_numeric_argument, << "collision_height" >>) else object.make_rect(object.position.x, object.position.y, attribute("collision_with").to_double, attribute("collision_height").to_double, attribute("collision_group").to_integer) end elseif attribute("collision_type").is_equal("circle") then if not has_attribute("collision_radius") then set_error (Mandatory_attribute_missing, << "collision_radius" >>) elseif not attribute("collision_radius").is_double then set_error (Non_numeric_argument, << "collision_radius" >>) else object.make_circle(object.position.x, object.position.y, attribute("collision_radius").to_double, attribute("collision_group").to_integer) end else set_error (Unknown_type, << "collision_type" >>) end else object.update_group(void, attribute("collision_group").to_integer) end object.update_collidable(level.collision_detector, true) else set_error (Non_numeric_argument, << "collision_group" >>) end end end end