Ejemplo n.º 1
0
 public static bool UpdatePathsIfPossible(this GameLevel gameLevel)
 {
     for (int i = 0; i < gameLevel.SpawnPoints.Count; i++)
     {
         for (int j = 0; j < gameLevel.GoalPoints.Count; j++)
         {
             var list = gameLevel.GetPath(gameLevel.SpawnPoints[i], gameLevel.GoalPoints[j]);
             if (list.GetListOfCoordinates().Count == 0)
             {
                 return(false);
             }
             var storedPaths = gameLevel.GetStoredPaths();
             storedPaths[i * gameLevel.SpawnPoints.Count + j] = list;
         }
     }
     gameLevel.UpdateTracers();
     return(true);
 }