inline int ProcessNode(struct Map * themap,struct Path * route,unsigned int parent_node,unsigned int node_to_proc) { /* Each time process node is called we want to check "node_to_proc" and the parent_node is the previous node */ if ( (route->done==0) && ( node_to_proc < themap->world_total_size) ) // IF NOT DONE AND INSIDE WORLD! { ExpandNodeFromNode( themap,route , parent_node , node_to_proc , route->node_direction , themap->turning_penalty); if (node_to_proc == route->target) { //printf("Target Just Reached :D\n"); // We found the target! :D themap->world[route->target].opened=1; ++route->solutions_gathered; } else { OpenNode(themap,route,parent_node,node_to_proc); } } return 0; }
status_t Model::SetTo(const BEntry *entry, bool open, bool writable) { delete fNode; fNode = NULL; DeletePreferredAppVolumeNameLinkTo(); fIconFrom = kUnknownSource; fBaseType = kUnknownNode; fMimeType = ""; fStatus = entry->GetRef(&fEntryRef); if (fStatus != B_OK) return fStatus; fStatus = entry->GetStat(&fStatBuf); if (fStatus != B_OK) return fStatus; fStatus = OpenNode(writable); if (!open) CloseNode(); return fStatus; }