Exemplo n.º 1
0
        private void BuildPathableMap()
        {
            thisMap = new PathingMap(template.Width, template.Height);

            for (int i = 0; i < template.Width; i++)
            {
                for (int j = 0; j < template.Height; j++)
                {
                    thisMap.setCell(i, j,
                                    RoomTemplateTerrainWalkable.terrainWalkable[template.terrainMap[i, j]] ? PathingTerrain.Walkable : PathingTerrain.Unwalkable);
                }
            }
        }
Exemplo n.º 2
0
        private void BuildPathableMap()
        {
            pathFinding = new LibTCOD.TCODPathFindingWrapper();

            pathingMap = new PathingMap(template.Width, template.Height);

            for (int i = 0; i < template.Width; i++)
            {
                for (int j = 0; j < template.Height; j++)
                {
                    pathingMap.setCell(i, j,
                                       RoomTemplateTerrainWalkable.terrainWalkable[template.terrainMap[i, j]] ? PathingTerrain.Walkable : PathingTerrain.Unwalkable);
                }
            }

            pathFinding.updateMap(0, pathingMap);
        }
Exemplo n.º 3
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));
        }