bool FindMatch() { MatchResult match; PathElement destination; if (TaskFinder.TaskFromMatch(currentElement, previousMatch, out match)) { StartMatch(match); return(true); } else if (TaskFinder.TaskFromPathElement(currentElement, out match)) { StartMatch(match); return(true); } else if (TaskFinder.TaskFromConnections(currentElement, out destination, out match)) { if (destination != null) { SetDestination(destination); } else if (match != null) { StartMatch(match); } return(true); } else if (TaskFinder.NearestPairFromDisabledTask(currentElement, out destination)) { SetDestination(destination); return(true); } return(false); }
void AssignPoint(PathElement elem) { MatchResult match; if (TaskFinder.TaskFromPathElement(elem, out match)) { Indicator.SetTask(match.Match); } else { Indicator.RemoveTask(); } if (elem != currentElement) { StopMatch(); SetDestination(elem); } }