Exemplo n.º 1
0
 void StartRandomSearch()
 {
     destination   = new Vector2(random.Next(0, graphics.PreferredBackBufferWidth / gridSize - 1), random.Next(0, graphics.PreferredBackBufferHeight / gridSize - 1));
     startPosition = new Vector2(random.Next(0, graphics.PreferredBackBufferWidth / gridSize - 1), random.Next(0, graphics.PreferredBackBufferHeight / gridSize - 1));
     myCat.SetImmediatePosition(startPosition * gridSize, gridSize);
     graph = new Graph(grid, graphics.PreferredBackBufferWidth / gridSize, graphics.PreferredBackBufferHeight / gridSize, myCat);
     graph.BreadthFirstSearchInitialize(startPosition, destination);
 }
Exemplo n.º 2
0
 void ResetGridForBreadth(bool startFromCurrentPosition)
 {
     if (startFromCurrentPosition)
     {
         startPosition = graph.curNodePosition;
     }
     myCat.SetImmediatePosition(startPosition * gridSize, gridSize);
     graph = new Graph(grid, graphics.PreferredBackBufferWidth / gridSize, graphics.PreferredBackBufferHeight / gridSize, myCat);
     graph.BreadthFirstSearchInitialize(startPosition, destination);
 }
Exemplo n.º 3
0
 void ResetGridForBreadth(bool startFromCurrentPosition)
 {
     if (startFromCurrentPosition)
         startPosition = graph.curNodePosition;
     myCat.SetImmediatePosition(startPosition * gridSize, gridSize);
     graph = new Graph(grid, graphics.PreferredBackBufferWidth / gridSize, graphics.PreferredBackBufferHeight / gridSize, myCat);
     graph.BreadthFirstSearchInitialize(startPosition, destination);
 }
Exemplo n.º 4
0
 void StartRandomSearch()
 {
     destination = new Vector2(random.Next(0, graphics.PreferredBackBufferWidth / gridSize - 1), random.Next(0, graphics.PreferredBackBufferHeight / gridSize - 1));
     startPosition = new Vector2(random.Next(0, graphics.PreferredBackBufferWidth / gridSize - 1), random.Next(0, graphics.PreferredBackBufferHeight / gridSize - 1));
     myCat.SetImmediatePosition(startPosition * gridSize, gridSize);
     graph = new Graph(grid, graphics.PreferredBackBufferWidth / gridSize, graphics.PreferredBackBufferHeight / gridSize, myCat);
     graph.BreadthFirstSearchInitialize(startPosition, destination);
 }