/** * 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 */ public DijkstraMap(final char[][] level) { this(level, Measurement.MANHATTAN, new GWTRNG()); }
/** * Creates a copy of this GWTRNG; it will generate the same random numbers, given the same calls in order, as this * GWTRNG at the point copy() is called. The copy will not share references with this GWTRNG. * * @return a copy of this GWTRNG */ @Override public GWTRNG copy() { return new GWTRNG(stateA, stateB); }
public GrowingTreeMazeGenerator(int width, int height) { this.width = width; this.height = height; rng = new GWTRNG(); } public GrowingTreeMazeGenerator(int width, int height, IRNG rng) {
/** * Constructs a DungeonBoneGen that uses a default RNG, randomly seeded. */ public DungeonBoneGen() { this(new GWTRNG()); }
/** * Creates a new dice roller that will use its own RNG, seeded with the given seed. * @param seed a long to use as a seed for a new RNG (can also be an int, short, or byte) */ public Dice(long seed) { rng = new GWTRNG(seed); } /**
public PacMazeGenerator(int width, int height) { this.height = height; this.width = width; rng = new GWTRNG(); }
/** * Creates the generator by seeding the provided list of names. * * @param names an array of Strings that are typical names to be emulated * @param consonantLimit the maximum allowed consonants in a row */ public WeightedLetterNamegen(String[] names, int consonantLimit) { this(names, consonantLimit, new GWTRNG()); }
/** * Sets up the generator to make mazes the given width and height. The mazes * have a solid wall border. * * @param width * @param height */ public DividedMazeGenerator(int width, int height) { this.width = width; this.height = height; rng = new GWTRNG(); }
/** * 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. This constructor specifies a distance measurement. * * @param level * @param measurement */ public DijkstraMap(final char[][] level, Measurement measurement) { this(level, measurement, new GWTRNG()); }
public DenseRoomMapGenerator(int width, int height) { this(width, height, new GWTRNG()); } public DenseRoomMapGenerator(int width, int height, IRNG rng)
/** * Used to construct a Spill from the output of another. * @param level the level as a 2D rectangular boolean array, using {@code false} to represent walls */ public Spill(final boolean[][] level) { rng = new GWTRNG(); initialize(level); } /**
/** * Constructs a new Thesaurus, seeding its RNG (used to shuffle word order) with shuffleSeed. * @param shuffleSeed a long for seeding this class' RNG */ public Thesaurus(long shuffleSeed) { mappings = new OrderedMap<>(256, Hashers.caseInsensitiveStringHasher); this.rng = new GWTRNG(shuffleSeed); }
/** * Constructs a new Thesaurus with an unseeded RNG used to shuffle word order. */ public Thesaurus() { mappings = new OrderedMap<>(256, Hashers.caseInsensitiveStringHasher); rng = new GWTRNG(); }
/** * Used to construct a DijkstraMap from the output of another, specifying a distance calculation. * * @param level * @param measurement */ public DijkstraMap(final double[][] level, Measurement measurement) { rng = new GWTRNG(); this.measurement = measurement; path = new ArrayList<>(); initialize(level); }
/** * Used to construct a CustomDijkstraMap from the output of another, specifying a distance calculation. * * @param level * @param adjacency */ public CustomDijkstraMap(final double[] level, Adjacency adjacency) { rng = new GWTRNG(); this.adjacency = adjacency; path = new IntVLA(); initialize(level); }
/** * Constructs a new Thesaurus, seeding its RNG (used to shuffle word order) with the next long from the given RNG. * @param rng an RNG that will only be used to get one long (for seeding this class' RNG) */ public Thesaurus(IRNG rng) { mappings = new OrderedMap<>(256, Hashers.caseInsensitiveStringHasher); this.rng = new GWTRNG(rng.nextLong()); }
/** * Constructs a new Thesaurus, seeding its RNG (used to shuffle word order) with shuffleSeed. * @param shuffleSeed a String for seeding this class' RNG */ public Thesaurus(String shuffleSeed) { mappings = new OrderedMap<>(256, Hashers.caseInsensitiveStringHasher); this.rng = new GWTRNG(CrossHash.hash64(shuffleSeed)); }
/** * Construct a Spill without a level to actually scan. This constructor allows you to specify an RNG, but the actual * RandomnessSource the RNG that this object uses will not be identical to the one passed as random (two ints will * be requested from the passed RNG, and that will be used to seed this class' RNG). * * If you use this constructor, you must call an initialize() method before using this class. */ public Spill(IRNG random) { rng = new GWTRNG(random.nextInt(), random.nextInt()); fresh = new OrderedSet<>(); }
/** * Construct a SoundMap without a level to actually scan. If you use this constructor, you must call an * initialize() method before using this class. */ public SoundMap() { rng = new GWTRNG(); alerted = new OrderedMap<>(); fresh = new OrderedMap<>(); sounds = new OrderedMap<>(); }
/** * Used to construct a SoundMap from the output of another. Any sounds will need to be assigned again. * @param level */ public SoundMap(final double[][] level) { rng = new GWTRNG(); alerted = new OrderedMap<>(); fresh = new OrderedMap<>(); sounds = new OrderedMap<>(); initialize(level); } /**