Beispiel #1
0
        private List<int> RebuildAllMaps()
        {
            List<int> dungeonLevelsToTest = new List<int>();

            int totalLevels = 5; //15
            for (int i = 0; i < totalLevels; i++)
            {
                dungeonLevelsToTest.Add(i);
            }

            bool experimentalTemplateGen = false;

            if(!experimentalTemplateGen)
                SpawnMapFlatline(dungeonLevelsToTest, false);
            else
            {
                //Setup a single test level

                MapGeneratorTemplated templateGen = new MapGeneratorTemplated();
                Map templateMap = templateGen.GenerateMap();
                int levelNo = Game.Dungeon.AddMap(templateMap);

                CalculateWalkableAndTCOD();
            }

            //Write maps to disk
            MapExport exporter = new MapExport();

            int index = 0;
            foreach (Map map in Game.Dungeon.Levels)
            {
                exporter.ExportMapToTextFile(map, "map-" + index + ".txt");
                index++;
            }

            return dungeonLevelsToTest;
        }