/** * Copies all fields from copying and makes a new DungeonGenerator. * @param copying the DungeonGenerator to copy */ public SectionDungeonGenerator(SectionDungeonGenerator copying) { rng = new StatefulRNG(copying.rng.getState()); utility = new DungeonUtility(rng); rebuildSeed = rng.getState(); height = copying.height; width = copying.width; Coord.expandPoolTo(width, height); roomFX = new EnumMap<>(copying.roomFX); corridorFX = new EnumMap<>(copying.corridorFX); caveFX = new EnumMap<>(copying.caveFX); doorFX = copying.doorFX; lakeFX = copying.lakeFX; deepLakeGlyph = copying.deepLakeGlyph; shallowLakeGlyph = copying.shallowLakeGlyph; dungeon = copying.dungeon; }
/** * Make a SectionDungeonGenerator with the given height, width, and RNG. Use this if you want to seed the RNG. If * width or height is greater than 256, then this will expand the Coord pool from its 256x256 default so it stores a * reference to each Coord that might be used in the creation of the dungeon (if width and height are 300 and 300, * the Coord pool will be 300x300; if width and height are 500 and 100, the Coord pool will be 500x256 because it * won't shrink below the default size of 256x256). * @param width The width of the dungeon in cells * @param height The height of the dungeon in cells * @param rng The RNG to use for all purposes in this class; if it is a StatefulRNG, then it will be used as-is, * but if it is not a StatefulRNG, a new StatefulRNG will be used, randomly seeded by this parameter */ public SectionDungeonGenerator(int width, int height, IRNG rng) { Coord.expandPoolTo(width, height); this.rng = (rng instanceof StatefulRNG) ? (StatefulRNG) rng : new StatefulRNG(rng.nextLong()); utility = new DungeonUtility(this.rng); rebuildSeed = this.rng.getState(); this.height = height; this.width = width; roomFX = new EnumMap<>(FillEffect.class); corridorFX = new EnumMap<>(FillEffect.class); caveFX = new EnumMap<>(FillEffect.class); }
/** * Copies all fields from copying and makes a new DungeonGenerator. * @param copying the DungeonGenerator to copy */ public DungeonGenerator(DungeonGenerator copying) { rng = new GWTRNG(copying.rng.getState()); gen = new DungeonBoneGen(rng); utility = new DungeonUtility(rng); rebuildSeed = rng.getState(); height = copying.height; width = copying.width; Coord.expandPoolTo(width, height); fx = new EnumMap<>(copying.fx); dungeon = copying.dungeon; }
/** * Given a resistance array as produced by {@link squidpony.squidgrid.mapping.DungeonUtility#generateResistances(char[][])} * or {@link squidpony.squidgrid.mapping.DungeonUtility#generateSimpleResistances(char[][])}, makes a * LightingHandler that can have {@link Radiance} objects added to it in various locations. * @param resistance a resistance array as produced by DungeonUtility * @param backgroundColor the background color to use, as a packed float (produced by {@link Color#toFloatBits()}) * @param radiusStrategy the shape lights should take, typically {@link Radius#CIRCLE} for "realistic" lights or one * of {@link Radius#DIAMOND} or {@link Radius#SQUARE} to match game rules for distance * @param viewerVisionRange how far the player can see without light, in cells */ public LightingHandler(double[][] resistance, float backgroundColor, Radius radiusStrategy, double viewerVisionRange) { this.radiusStrategy = radiusStrategy; viewerRange = viewerVisionRange; this.backgroundColor = backgroundColor; resistances = resistance; width = resistances.length; height = resistances[0].length; fovResult = new double[width][height]; tempFOV = new double[width][height]; losResult = new double[width][height]; colorLighting = SColor.blankColoredLighting(width, height); tempColorLighting = new float[2][width][height]; Coord.expandPoolTo(width, height); lights = new OrderedMap<>(32); noticeable = new GreasedRegion(width, height); }
/** * Make a DungeonGenerator with the given height, width, and RNG. Use this if you want to seed the RNG. If width or * height is greater than 256, then this will expand the Coord pool from its 256x256 default so it stores a * reference to each Coord that might be used in the creation of the dungeon (if width and height are 300 and 300, * the Coord pool will be 300x300; if width and height are 500 and 100, the Coord pool will be 500x256 because it * won't shrink below the default size of 256x256). * @param width The width of the dungeon in cells * @param height The height of the dungeon in cells * @param rng The RNG to use for all purposes in this class; if it is a StatefulRNG, then it will be used as-is, * but if it is not a StatefulRNG, a new StatefulRNG will be used, randomly seeded by this parameter */ public DungeonGenerator(int width, int height, IRNG rng) { Coord.expandPoolTo(width, height); this.rng = (rng instanceof IStatefulRNG) ? (IStatefulRNG) rng : new GWTRNG(rng.nextLong()); gen = new DungeonBoneGen(this.rng); utility = new DungeonUtility(this.rng); rebuildSeed = this.rng.getState(); this.height = height; this.width = width; fx = new EnumMap<>(FillEffect.class); }
height = land.height; MultiSpill spreader = new MultiSpill(new short[width][height], Spill.Measurement.MANHATTAN, rng); Coord.expandPoolTo(width, height); GreasedRegion map = land.copy();
height = land.height; MultiSpill spreader = new MultiSpill(new short[width][height], Spill.Measurement.MANHATTAN, rng); Coord.expandPoolTo(width, height); GreasedRegion map = land.copy();
height = land.height; MultiSpill spreader = new MultiSpill(new short[width][height], Spill.Measurement.MANHATTAN, rng); Coord.expandPoolTo(width, height); GreasedRegion map = land.copy();