/** * Constructs a FantasyPoliticalMapper, but doesn't do anything with a map; you need to call * {@link #generate(long, WorldMapGenerator, WorldMapGenerator.BiomeMapper, Collection, int, double)} for results. */ public FantasyPoliticalMapper() { rng = new StatefulRNG(); }
/** * Make a SectionDungeonGenerator with the given height and width; the RNG used for generating a dungeon and * adding features will be a LightRNG using a random seed. 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 */ public SectionDungeonGenerator(int width, int height) { this(width, height, new StatefulRNG()); }
public MetsaMapFactory() { this(240, 120, new StatefulRNG()); } public MetsaMapFactory(int width, int height)
public MetsaMapFactory(int width, int height) { this(width, height, new StatefulRNG()); } public MetsaMapFactory(int width, int height, long rngSeed)
public MetsaMapFactory(int width, int height, long rngSeed) { this(width, height, new StatefulRNG(rngSeed)); }
public DungeonUtility() { rng = new StatefulRNG(); }
/** * Construct a Spill without a level to actually scan. This constructor allows you to specify the state to be used * for the RNG without actually passing an RNG, since this will use its own anyway. * * If you use this constructor, you must call an initialize() method before using this class. * @param state the state to use for this class' random number generator */ public MultiSpill(long state) { rng = new StatefulRNG(state); fresh = new ArrayList<>(); } /**
/** * Construct a Spill without a level to actually scan. If you use this constructor, you must call an * initialize() method before using this class. */ public MultiSpill() { rng = new StatefulRNG(); fresh = new ArrayList<>(); } /**
/** * Used to construct a Spill from the output of another. * @param level a short[][] that should have been the spillMap of another MultiSpill */ public MultiSpill(final short[][] level) { rng = new StatefulRNG(); initialize(level); } /**
/** * Constructs a SpillWorldMap using the given world name, and uses the world name as the * basis for all future random generation in this object. * * @param worldName a String name for the world that will be used as a seed for all random generation here */ public PoliticalMapper(String worldName) { name = worldName; rng = new StatefulRNG(CrossHash.hash64(name)); } /**
/** * Used to construct a Spill from the output of another, specifying a distance calculation. * @param level a short[][] that should have been the spillMap of another MultiSpill * @param measurement a Spill.Measurement that should usually be MANHATTAN */ public MultiSpill(final short[][] level, Measurement measurement) { rng = new StatefulRNG(); this.measurement = measurement; initialize(level); } /**
public PoliticalMapper() { name = "Permadeath Planet"; rng = new StatefulRNG(CrossHash.hash64(name)); } /**
/** * Creates a copy of this StatefulRNG; it will generate the same random numbers, given the same calls in order, as * this StatefulRNG at the point copy() is called. The copy will not share references with this StatefulRNG. * * @return a copy of this StatefulRNG */ @Override public StatefulRNG copy() { return new StatefulRNG(random.copy()); }
public SpillWorldMap() { width = 20; height = 20; name = "Permadeath Island"; rng = new StatefulRNG(CrossHash.hash64(name)); } /**
public DungeonUtility(IRNG rng) { this.rng = new StatefulRNG(rng.nextLong()); }
/** * Constructs a SpillWorldMap using the given width, height, and world name, and uses the world name as the * basis for all future random generation in this object. * * @param width the width of the map in cells * @param height the height of the map in cells * @param worldName a String name for the world that will be used as a seed for all random generation here */ public SpillWorldMap(int width, int height, String worldName) { this.width = Math.max(width, 20); this.height = Math.max(height, 20); name = worldName; rng = new StatefulRNG(CrossHash.hash64(name)); }
/** * Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other * char[][] where '#' means a wall and anything else is a walkable tile. If you only have * a map that uses box-drawing characters, use DungeonUtility.linesToHashes() to get a * map that can be used here. * * @param level a char[][] that should use '#' for walls and '.' for floors */ public MultiSpill(final char[][] level) { rng = new StatefulRNG(); initialize(level); } /**
/** * Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other * char[][] where one char means a wall and anything else is a walkable tile. If you only have * a map that uses box-drawing characters, use DungeonUtility.linesToHashes() to get a * map that can be used here. You can specify the character used for walls. * * @param level a char[][] that should use alternateWall for walls and '.' for floors * @param alternateWall the char to use for walls */ public MultiSpill(final char[][] level, char alternateWall) { rng = new StatefulRNG(); initialize(level, alternateWall); }
/** * Make a SectionDungeonGenerator with a LightRNG using a random seed, height 40, and width 40. */ public SectionDungeonGenerator() { rng = new StatefulRNG(); utility = new DungeonUtility(rng); rebuildSeed = rng.getState(); height = 40; width = 40; roomFX = new EnumMap<>(FillEffect.class); corridorFX = new EnumMap<>(FillEffect.class); caveFX = new EnumMap<>(FillEffect.class); }
@Override public StatefulRNG restore(String text) { long state = StringKit.longFromHex(text); try { StatefulRandomness sr = (StatefulRandomness) ClassReflection.newInstance(ClassReflection.forName(text.substring(text.indexOf(':') + 1))); sr.setState(state); return new StatefulRNG(sr); }catch (Exception re) { return new StatefulRNG(state); } } };