コード例 #1
0
ファイル: MapGeneratorCave.cs プロジェクト: vrum/roguelike
        private bool ArePointsConnected(Point firstPoint, Point secondPoint)
        {
            //Build map representations
            PathingMap map = new PathingMap(Width, Height);

            for (int i = 0; i < Width; i++)
            {
                for (int j = 0; j < Height; j++)
                {
                    map.setCell(i, j, baseMap.mapSquares[i, j].Walkable ? PathingTerrain.Walkable : PathingTerrain.Unwalkable);
                }
            }

            //Try to walk a path between the 2 staircases
            LibTCOD.TCODPathFindingWrapper pathFinder = new LibTCOD.TCODPathFindingWrapper();
            pathFinder.updateMap(0, map);
            return(pathFinder.arePointsConnected(0, firstPoint, secondPoint, Pathing.PathingPermission.Normal));
        }
コード例 #2
0
        private bool ArePointsConnected(Point firstPoint, Point secondPoint)
        {
            //Build map representations
            PathingMap map = new PathingMap(Width, Height);
            for (int i = 0; i < Width; i++)
            {
                for (int j = 0; j < Height; j++)
                {
                    map.setCell(i, j, baseMap.mapSquares[i, j].Walkable ? PathingTerrain.Walkable : PathingTerrain.Unwalkable);
                }
            }

            //Try to walk a path between the 2 staircases
            LibTCOD.TCODPathFindingWrapper pathFinder = new LibTCOD.TCODPathFindingWrapper();
            pathFinder.updateMap(0, map);
            return pathFinder.arePointsConnected(0, firstPoint, secondPoint, Pathing.PathingPermission.Normal);
        }