1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
create or replace function getWayTo(dest TCrossPoint, path TCrossPointList) returns boolean
as
found boolean := false;
cursor exits is select DEREF(s.endPoint) from slope s, table(s.parts) sparts
where sparts.startPoint=REF(self);
begin
open exits;
loop
fetch exits into point;
exit when exits%notfound;
path.extend;
path(path.last) := point;
if(point.getWayTo(dest, path)) then
found := true;
exit;
else
path.delete(path.last);
end if;
end loop;
close exits;
return found;
end; |
Partager