private void FillMax(int[,] arr, List <GridSystem.Cell> q)
 {
     for (int i = 0; i < grid.Width; i++)
     {
         for (int j = 0; j < grid.Height; j++)
         {
             arr[i, j] = int.MaxValue;
             q.Add(grid.GetCellAt(i, j));
         }
     }
 }
    void CreateBoardTiles()
    {
        BoardTiles = new Tile[GridWidth, GridHeight];
        GridSystem.Grid gameGrid = GameGridSystem.MainGameGrid;
        foreach (var entrance in gameGrid.Entrances)
        {
            _gmInstance.SearchFlyingPath(entrance.X, entrance.Y);
        }
        Vector3 startPosition = new Vector3(0f, 0f, 0f);

        startPosition.x = 0 - (GridWidth / 2.0f) * TileSize;
        startPosition.y = 0 - (GridHeight / 2.0f) * TileSize;
        startPosition.z = 0f;

        //Create grid
        for (int y = 0; y < GridHeight; ++y)
        {
            for (int x = 0; x < GridWidth; ++x)
            {
                GridSystem.Cell cell = gameGrid.GetCellAt(x, y);

                if (cell.IsEntrance)
                {
                    BoardTiles[x, y] = new Tile(TileEntrance, x, y, TileSize, _boardHolder, startPosition);
                }
                else if (cell.IsExit)
                {
                    BoardTiles[x, y] = new Tile(TileExit, x, y, TileSize, _boardHolder, startPosition);
                }
                else if (cell.IsBlocked)
                {
                    BoardTiles[x, y] = new Tile(TileObstacles, x, y, TileSize, _boardHolder, startPosition);
                }
                else
                {
                    BoardTiles[x, y] = new Tile(TileGound, x, y, TileSize, _boardHolder, startPosition);
                }
            }
        }
    }