Example #1
0
 public void SearchInit()
 {
     nodescount = 0;
     isOver     = false;
     TargetPath.Clear();
     TargetNode = nodes = new PathNode(nodescount++);
     searchStack.Clear();
     searchStack.Push(nodes);
     nodes[PathType.Forward] = new PathNode(nodescount++);
     nodes[PathType.Forward][PathType.Back] = nodes;
     lastNode = nodes[PathType.Forward];
     LastDir.Reset();
     LastPathDirValue.Reset();
     setCarNode(nodes);
     TurnBack  = false;
     WayLenght = true;
 }
Example #2
0
 public Bitmap Update()
 {
     xpos = map.Width / 2;
     ypos = map.Height / 2;
     Draw.Clear(Color.White);
     NodeList.Clear();
     DrawPathList(xpos, ypos, nodes);
     DrawTargetPath();
     updateCar(lastlenght);
     //DrawPath(xpos,ypos,nodes);
     //findDir.Rotate(PathType.Back);
     //DrawPath(nodes[PathType.Forward].x, nodes[PathType.Forward].y, nodes[PathType.Forward],PathType.Back);
     findDir.Reset();
     return(map);
 }