Beispiel #1
0
    public Stack <Pair <int, int> > TracePath()
    {
        Stack <Pair <int, int> > path = new Stack <Pair <int, int> >();

        int i, j;

        i = endPosition.X;
        j = endPosition.Y;
        while (!pfGrid.HasNoParents(i, j, i, j))
        {
            path.Push(new Pair <int, int>(i, j));
            int tempI = pfGrid.GetIParent(i, j);
            int tempJ = pfGrid.GetjParent(i, j);

            i = tempI;
            j = tempJ;
        }

        return(path);
    }