Exemple #1
0
 public static List <Vector2f> Find(AStarFindHeuristic heuristic,
                                    Field2D maps, int x1, int y1, int x2, int y2, bool flag)
 {
     return(Find(heuristic, maps.GetMap(), maps.GetLimit(), x1, y1, x2, y2,
                 flag));
 }
Exemple #2
0
 public static List <Vector2f> Find(AStarFindHeuristic heuristic,
                                    Field2D maps, Vector2f start, Vector2f goal, bool flag)
 {
     return(Find(heuristic, maps.GetMap(), maps.GetLimit(), start.X(),
                 start.Y(), goal.X(), goal.Y(), flag));
 }
 public Field2D GetField2D(string name, int width, int height,
         Field2D fallback)
 {
     int[][] arrays = GetArray2D(name,
             (fallback == null) ? null : fallback.GetMap());
     if (arrays != null)
     {
         return new Field2D(arrays, width, height);
     }
     return null;
 }
Exemple #4
0
 public static List<Vector2f> Find(AStarFindHeuristic heuristic,
         Field2D maps, Vector2f start, Vector2f goal, bool flag)
 {
     return Find(heuristic, maps.GetMap(), maps.GetLimit(), start.X(),
             start.Y(), goal.X(), goal.Y(), flag);
 }
Exemple #5
0
 public static List<Vector2f> Find(AStarFindHeuristic heuristic,
         Field2D maps, int x1, int y1, int x2, int y2, bool flag)
 {
     return Find(heuristic, maps.GetMap(), maps.GetLimit(), x1, y1, x2, y2,
             flag);
 }
Exemple #6
0
 public int[][] GetMap()
 {
     return(field.GetMap());
 }
Exemple #7
0
 /// <summary>
 /// 设定Layer对应的二维数组地图
 /// </summary>
 ///
 /// <param name="map"></param>
 public void SetField2D(Field2D field)
 {
     if (isClose)
     {
         return;
     }
     if (field == null)
     {
         return;
     }
     if (tmpField != null)
     {
         if ((field.GetMap().Length == tmpField.GetMap().Length)
                 && (field.GetTileWidth() == tmpField.GetTileWidth())
                 && (field.GetTileHeight() == tmpField.GetTileHeight()))
         {
             tmpField.Set(field.GetMap(), field.GetTileWidth(),
                     field.GetTileHeight());
         }
     }
     else
     {
         tmpField = field;
     }
 }