Ejemplo n.º 1
0
        public PathFinder(LevelMap map)
        {
            doneCalculating = false;
            SetMapTiles(map);

            currentCoordinates = new List<Vector2>();
            adjacentCoordinates = new List<Vector2>();
            nextCurrentCoordinates = new List<Vector2>();
            completeCoordinates = new List<Vector2>();
        }
Ejemplo n.º 2
0
        public void SetMapTiles(LevelMap map)
        {
            mapDemensions = map.MAPSIZE;
            gameTiles = new int[(int)mapDemensions.X, (int)mapDemensions.Y];

            for (int row = 0; row < mapDemensions.X; row++)
                for (int col = 0; col < mapDemensions.Y; col++)
                {
                    if (map.GetTileState(row, col))
                    {
                        gameTiles[row, col] = -1;
                    }
                    else
                        gameTiles[row, col] = 0;
                }
        }
Ejemplo n.º 3
0
 public void UpDateTiles(LevelMap map)
 {
     for (int row = 0; row < mapDemensions.X; row++)
         for (int col = 0; col < mapDemensions.Y; col++)
         {
             if (map.GetTileState(row, col))
             {
                 gameTiles[row, col] = -1;
             }
             else
                 gameTiles[row, col] = 0;
         }
 }
Ejemplo n.º 4
0
 public void HighlightPath(LevelMap map)
 {
     map.HighlightPath(this);
 }