Ejemplo n.º 1
0
        public CaveGenerator(int width, int height, String name, double fillPercentage, int smoothness, Quinoa quinoa)
        {
            header = new RegionHeader(name);
            region = new Region(width, height);
            header.setRegion(region);
            entrance = new RegionExit(width / 2, height / 2, 0, 0, "", ExitDecorator.UP_STAIR);
            exit = new RegionExit(width / 2, (height / 2) + 1, 0, 0, "", ExitDecorator.DOWN_STAIR);
            header.getExits().Add(entrance);
            header.getExits().Add(exit);
            region.setLightingModel(LightingModel.CAVE);
            this.quinoa = quinoa;
            this.fillPercentage = fillPercentage;
            this.smoothness = smoothness;

            chambers = new List<Chamber>();

            //fill with solid rock
            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    region.setTerrain(x, y, new Terrain());
                    region.getTerrain(x, y).setCode(TerrainCode.ROCK);
                }
            }
        }
Ejemplo n.º 2
0
 public TownGenerator(int width, int height, String name, int wiggle, double radius, double treeDensity, OverworldCell overworldCell, Quinoa quinoa)
 {
     header = new RegionHeader(name);
     region = new Region(width, height);
     header.setRegion(region);
     header.setName(NameMaker.makeTrivialPlaceName());
     this.wiggle = wiggle;
     this.radius = radius;
     this.treeDensity = treeDensity;
     this.quinoa = quinoa;
     this.overworldCell = overworldCell;
 }
Ejemplo n.º 3
0
        public ForestGenerator(int width, int height, String name, double treeDensity, Quinoa quinoa)
        {
            header = new RegionHeader(name);
            region = new Region(width, height);
            header.setRegion(region);
            region.setLightingModel(LightingModel.ABOVE_GROUND);
            this.quinoa = quinoa;
            this.treeDensity = treeDensity;

            //fill the forest with grass
            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    region.setTerrain(x, y, new Terrain());
                    region.getTerrain(x, y).setCode(TerrainCode.GRASS);
                }
            }
        }