Uses of Class
squidpony.squidmath.GreasedRegion
Package | Description |
---|---|
squidpony |
Utilities that don't fit elsewhere in SquidLib; mostly text manipulation, compression, and helper code.
|
squidpony.squidai |
Tools for finding paths, optimizing targets for area-of-effect (AOE) abilities, and evaluating influence on a grid.
|
squidpony.squidgrid |
Tools for working with data on a grid, including LOS and FOV; overlaps with geometry code in squidpony.squidmath .
|
squidpony.squidgrid.mapping |
Tools specifically for generating maps and placing content in them, usually working with 2D char arrays.
|
squidpony.squidgrid.mapping.styled |
Support code for working with tiled dungeon generation; normally only
TilesetType is used outside SquidLib. |
squidpony.squidmath |
A very broad package containing random number generators, geometry tools, data structures, and noise functions.
|
-
Uses of GreasedRegion in squidpony
Fields in squidpony with type parameters of type GreasedRegion Modifier and Type Field Description static StringConvert<GreasedRegion>
Converters. convertGreasedRegion
-
Uses of GreasedRegion in squidpony.squidai
Methods in squidpony.squidai that return GreasedRegion Modifier and Type Method Description GreasedRegion[]
GreasedZOI. calculate()
Finds the zones of influence for each of the influences (inner arrays of Coord) this was constructed with, and returns all zones as a GreasedRegion array.protected GreasedRegion
GreasedZOI. increasing(double[][] dm, Coord[] inf)
GreasedRegion
Technique. possibleTargets(Coord user)
Gets all possible target-able Coords when using this technique from the given Coorduser
, returning them in a GreasedRegion.GreasedRegion
Technique. possibleTargets(Coord user, double[][] resistanceMap)
Gets all possible target-able Coords when using this technique from the given Coorduser
, returning them in a GreasedRegion.Methods in squidpony.squidai with parameters of type GreasedRegion Modifier and Type Method Description IntVLA
GreasedZOI. nearestInfluences(GreasedRegion[] zones, Coord point)
Given the zones resulting from this class'GreasedZOI.calculate()
method and a Coord to check, finds the indices of all influencing groups in zones that have the Coord in their area, and returns all such indices as an IntVLA.void
DijkstraMap. setGoals(GreasedRegion pts)
Marks many cells as goals for pathfinding, ignoring cells in walls or unreachable areas. -
Uses of GreasedRegion in squidpony.squidgrid
Fields in squidpony.squidgrid declared as GreasedRegion Modifier and Type Field Description protected GreasedRegion
MultiSpill. anyFreshMap
The cells that are filled by the any spiller will be true, others will be false.protected GreasedRegion
MultiSpill. anySpillMap
The cells that are filled by the any spiller will be true, others will be false.protected GreasedRegion
FOV. nearLight
Data allocated in the previous calls to the public API, if any. -
Uses of GreasedRegion in squidpony.squidgrid.mapping
Fields in squidpony.squidgrid.mapping declared as GreasedRegion Modifier and Type Field Description GreasedRegion
RoomFinder. allCaves
GreasedRegion
RoomFinder. allCorridors
GreasedRegion
RoomFinder. allFloors
GreasedRegion
RoomFinder. allRooms
GreasedRegion
WorldMapGenerator.LocalMimicMap. coast
GreasedRegion
WorldMapGenerator.MimicMap. coast
GreasedRegion
WorldMapGenerator.LocalMimicMap. earth
GreasedRegion
WorldMapGenerator.MimicMap. earth
GreasedRegion
WorldMapGenerator.LocalMimicMap. earthOriginal
GreasedRegion
WorldMapGenerator.MimicMap. earthOriginal
GreasedRegion
OrganicMapGenerator. floors
GreasedRegion
WorldMapGenerator. landData
GreasedRegion
ConnectingMapGenerator. region
GreasedRegion
WorldMapGenerator.LocalMimicMap. shallow
GreasedRegion
WorldMapGenerator.MimicMap. shallow
GreasedRegion
MapModule. validDoors
Stores Coords just outside the contents of the MapModule, where doors are allowed to connect into this.Fields in squidpony.squidgrid.mapping with type parameters of type GreasedRegion Modifier and Type Field Description OrderedMap<GreasedRegion,List<GreasedRegion>>
RoomFinder. caves
Not likely to be used directly, but there may be things you can do with these that are cumbersome using only RoomFinder's simpler API.OrderedMap<GreasedRegion,List<GreasedRegion>>
RoomFinder. caves
Not likely to be used directly, but there may be things you can do with these that are cumbersome using only RoomFinder's simpler API.OrderedMap<GreasedRegion,List<GreasedRegion>>
RoomFinder. corridors
Not likely to be used directly, but there may be things you can do with these that are cumbersome using only RoomFinder's simpler API.OrderedMap<GreasedRegion,List<GreasedRegion>>
RoomFinder. corridors
Not likely to be used directly, but there may be things you can do with these that are cumbersome using only RoomFinder's simpler API.protected ArrayList<GreasedRegion>
SectionMap. regions
OrderedMap<GreasedRegion,List<GreasedRegion>>
RoomFinder. rooms
Not likely to be used directly, but there may be things you can do with these that are cumbersome using only RoomFinder's simpler API.OrderedMap<GreasedRegion,List<GreasedRegion>>
RoomFinder. rooms
Not likely to be used directly, but there may be things you can do with these that are cumbersome using only RoomFinder's simpler API.Methods in squidpony.squidgrid.mapping that return GreasedRegion Modifier and Type Method Description GreasedRegion
SectionMap. nameToRegion(String name)
Gets the GreasedRegion that has the given name.GreasedRegion
SectionMap. numberToRegion(int number)
Gets the GreasedRegion that has the given identifying number.GreasedRegion
SectionMap. positionToContaining(int x, int y)
Gets the GreasedRegion (a group of points as made by the constructor) that contains the given x, y point.GreasedRegion
SectionMap. positionToContaining(Coord position)
Gets the GreasedRegion (a group of points as made by the constructor) that contains the given x, y point.static GreasedRegion
WorldMapGenerator.MimicMap. reprojectToElliptical(GreasedRegion rectangular)
Meant for making maps conform to the Mollweide (elliptical) projection that MimicMap uses.Methods in squidpony.squidgrid.mapping with parameters of type GreasedRegion Modifier and Type Method Description char[][]
PoliticalMapper. generate(GreasedRegion land, int factionCount, double controlledFraction)
Produces a political map for the land stored in the "on" cells of the given GreasedRegion, with the given number of factions trying to take land in the world (essentially, nations).char[][]
PoliticalMapper. generate(GreasedRegion land, Map<Character,String> existingAtlas, double controlledFraction)
Produces a political map for the land stored in the "on" cells of the given GreasedRegion, with the given number of factions trying to take land in the world (essentially, nations).char[][]
PoliticalMapper. generate(GreasedRegion land, OrderedMap<Character,FakeLanguageGen> atlasLanguages, double controlledFraction)
Produces a political map for the land stored in the "on" cells of the given GreasedRegion, with the given number of factions trying to take land in the world (essentially, nations).static char[][]
LineKit. pruneLines(char[][] map, GreasedRegion seen, char[][] writeInto)
Adjusts an existing map that uses box-drawing characters so non-visible line segments aren't rendered.static char[][]
LineKit. pruneLines(char[][] map, GreasedRegion seen, char[] symbols, char[][] writeInto)
Adjusts an existing map that uses box-drawing characters so non-visible line segments aren't rendered.static GreasedRegion
WorldMapGenerator.MimicMap. reprojectToElliptical(GreasedRegion rectangular)
Meant for making maps conform to the Mollweide (elliptical) projection that MimicMap uses.Constructors in squidpony.squidgrid.mapping with parameters of type GreasedRegion Constructor Description LocalMimicMap(long initialSeed, GreasedRegion toMimic)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, without projecting the land positions or changing heat by latitude.LocalMimicMap(long initialSeed, GreasedRegion toMimic, double octaveMultiplier)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, without projecting the land positions or changing heat by latitude.LocalMimicMap(long initialSeed, GreasedRegion toMimic, Noise.Noise2D noiseGenerator)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, without projecting the land positions or changing heat by latitude.LocalMimicMap(long initialSeed, GreasedRegion toMimic, Noise.Noise2D noiseGenerator, double octaveMultiplier)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, using an elliptical projection (specifically, a Mollweide projection).LocalMimicMap(GreasedRegion toMimic)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, without projecting the land positions or changing heat by latitude.MapModule(char[][] map, GreasedRegion validDoors, Coord min, Coord max)
Constructs a MapModule from the given arguments without modifying them, copying map without changing its size, copying validDoors, and using the same min and max (which are immutable, so they can be reused).MimicMap(long initialSeed, GreasedRegion toMimic)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, using an elliptical projection (specifically, a Mollweide projection).MimicMap(long initialSeed, GreasedRegion toMimic, double octaveMultiplier)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, using an elliptical projection (specifically, a Mollweide projection).MimicMap(long initialSeed, GreasedRegion toMimic, Noise.Noise3D noiseGenerator)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, using an elliptical projection (specifically, a Mollweide projection).MimicMap(long initialSeed, GreasedRegion toMimic, Noise.Noise3D noiseGenerator, double octaveMultiplier)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, using an elliptical projection (specifically, a Mollweide projection).MimicMap(GreasedRegion toMimic)
Constructs a concrete WorldMapGenerator for a map that should have land in roughly the same places as the given GreasedRegion's "on" cells, using an elliptical projection (specifically, a Mollweide projection). -
Uses of GreasedRegion in squidpony.squidgrid.mapping.styled
Fields in squidpony.squidgrid.mapping.styled declared as GreasedRegion Modifier and Type Field Description GreasedRegion
DungeonBoneGen. region
A GreasedRegion that, afterDungeonBoneGen.generate(TilesetType, int, int)
has been called, will hold the floor cells in its data as "on" cells and walls as "off" cells.GreasedRegion
DungeonBoneGen. workingRegion
Not recommended for general usage; a GreasedRegion that is frequently modified by this generator and is kept in a field so this and potentially other classes can avoid allocating new GreasedRegions withremake(GreasedRegion)
or the various refill methods in GreasedRegion. -
Uses of GreasedRegion in squidpony.squidmath
Fields in squidpony.squidmath declared as GreasedRegion Modifier and Type Field Description static GreasedRegion
MaskedShapeGenerator. alwaysSolid
GreasedRegion
CellularAutomaton. current
Returned directly by some methods, but you may want to change this at some other point.static GreasedRegion[]
BlueNoise. LEVELS
A 256-element array ofGreasedRegion
s, each 64x64, where the first GreasedRegion has an impossibly strict threshold on what points to include (it is empty), but the second has some points far apart, the third has more, and so on until the last element includes almost all points.static GreasedRegion
MaskedShapeGenerator. potentialBody
static GreasedRegion
MaskedShapeGenerator. potentialSolid
GreasedRegion
MaskedShapeGenerator. randomRegion
Methods in squidpony.squidmath that return GreasedRegion Modifier and Type Method Description GreasedRegion
GreasedRegion. allOn()
Sets all cells in this to "on."GreasedRegion
GreasedRegion. alterBounds(int widthChange, int heightChange)
Changes the width and/or height of this GreasedRegion, enlarging or shrinking starting at the edges wherex == width - 1
andy == height - 1
.GreasedRegion
GreasedRegion. and(GreasedRegion other)
Intersection of two GreasedRegions, assigning the result into this GreasedRegion.GreasedRegion
GreasedRegion. andNot(GreasedRegion other)
Difference of two GreasedRegions, assigning the result into this GreasedRegion.GreasedRegion
GreasedRegion. andWrapping64(GreasedRegion other)
Intersection of two GreasedRegions, assigning the result into this GreasedRegion, with the special requirement that other must be a 64x64 area, and the special property that other will be considered tiled to cover all of the area of this GreasedRegion.GreasedRegion
GreasedRegion. connect()
Takes the pairs of "on" cells in this GreasedRegion that are separated by exactly one cell in an orthogonal line, and changes the gap cells to "on" as well.GreasedRegion
GreasedRegion. connect8way()
Takes the pairs of "on" cells in this GreasedRegion that are separated by exactly one cell in an orthogonal or diagonal line, and changes the gap cells to "on" as well.GreasedRegion
GreasedRegion. connectLines()
Takes the pairs of "on" cells in this GreasedRegion that are separated by exactly one cell in an orthogonal or diagonal line, and changes the gap cells to "on" as well.GreasedRegion
GreasedRegion. copy()
Simple method that returns a newly-allocated copy of this GreasedRegion; modifications to one won't change the other, and this method returns the copy while leaving the original unchanged.GreasedRegion
GreasedRegion. copyRotated(int turns)
Makes a copy of this GreasedRegion that has been rotated 90 degreesturns
times.static GreasedRegion
GreasedRegion. decompress(String compressed)
Decompresses a String returned bytoCompressedString()
, returning a new GreasedRegion with identical width, height, and contents to the GreasedRegion before compression.static GreasedRegion
GreasedRegion. deserializeFromString(String s)
GreasedRegion
GreasedRegion. deteriorate(RandomnessSource random, double preservation)
Randomly removes points from a GreasedRegion, with preservation as a fraction between 1.0 (keep all) and 0.0 (remove all).GreasedRegion
GreasedRegion. deteriorate(RandomnessSource rng, int preservation)
Randomly removes points from a GreasedRegion, with larger values for preservation keeping more of the existing shape intact.GreasedRegion
GreasedRegion. disperse()
Removes "on" cells that are orthogonally adjacent to other "on" cells, keeping at least one cell in a group "on." Uses a "checkerboard" pattern to determine which cells to turn off, with all cells that would be black on a checkerboard turned off and all others kept as-is.GreasedRegion
GreasedRegion. disperse8way()
Removes "on" cells that are 8-way adjacent to other "on" cells, keeping at least one cell in a group "on." Uses a "grid-like" pattern to determine which cells to turn off, with all cells with even x and even y kept as-is but all other cells (with either or both odd x or odd y) turned off.GreasedRegion
GreasedRegion. disperseRandom(RandomnessSource random)
Removes "on" cells that are nearby other "on" cells, with a random factor to which bits are actually turned off that still ensures exactly half of the bits are kept as-is (the one exception is when height is an odd number, which makes the bottom row slightly random).GreasedRegion
GreasedRegion. empty()
Equivalent toclear()
, setting all cells to "off," but also returns this for chaining.GreasedRegion
GreasedRegion. expand()
Takes the "on" cells in this GreasedRegion and expands them by one cell in the 4 orthogonal directions, making each "on" cell take up a plus-shaped area that may overlap with other "on" cells (which is just a normal "on" cell then).GreasedRegion
GreasedRegion. expand(int amount)
Takes the "on" cells in this GreasedRegion and expands them by amount cells in the 4 orthogonal directions, making each "on" cell take up a plus-shaped area that may overlap with other "on" cells (which is just a normal "on" cell then).GreasedRegion
GreasedRegion. expand8way()
GreasedRegion
GreasedRegion. expand8way(int amount)
GreasedRegion[]
GreasedRegion. expandSeries(int amount)
Takes the "on" cells in this GreasedRegion and produces amount GreasedRegions, each one expanded by 1 cell in the 4 orthogonal directions relative to the previous GreasedRegion, making each "on" cell take up a plus-shaped area that may overlap with other "on" cells (which is just a normal "on" cell then).GreasedRegion[]
GreasedRegion. expandSeries8way(int amount)
GreasedRegion
GreasedRegion. extend()
Gets a new Zone that contains all the Coords inthis
plus all neighboring Coords, which can be orthogonally or diagonally adjacent to any Coord this has in it.GreasedRegion
GreasedRegion. fill(boolean contents)
Sets all cells in this to "on" if contents is true, or "off" if contents is false.GreasedRegion
GreasedRegion. flip(boolean leftRight, boolean upDown)
GreasedRegion
GreasedRegion. flood(GreasedRegion bounds)
Likeexpand()
, but limits expansion to the "on" cells ofbounds
.GreasedRegion
GreasedRegion. flood(GreasedRegion bounds, int amount)
Likeexpand(int)
, but limits expansion to the "on" cells ofbounds
.GreasedRegion
GreasedRegion. flood8way(GreasedRegion bounds)
Likeexpand8way()
, but limits expansion to the "on" cells ofbounds
.GreasedRegion
GreasedRegion. flood8way(GreasedRegion bounds, int amount)
Likeexpand8way(int)
, but limits expansion to the "on" cells ofbounds
.GreasedRegion[]
GreasedRegion. floodSeries(GreasedRegion bounds, int amount)
Repeatedly callsflood(GreasedRegion)
amount
times and returns the intermediate steps in a GreasedRegion array of sizeamount
.GreasedRegion[]
GreasedRegion. floodSeries8way(GreasedRegion bounds, int amount)
Repeatedly callsflood8way(GreasedRegion)
amount
times and returns the intermediate steps in a GreasedRegion array of sizeamount
.GreasedRegion
GreasedRegion. fray(double fractionKept)
Likeretract()
, this removes the "on" cells that are 4-way-adjacent to any "off" cell, but unlike that method it keeps a fraction of those surface cells, quasi-randomly selecting them.GreasedRegion
GreasedRegion. fringe()
Takes the "on" cells in this GreasedRegion and expands them by one cell in the 4 orthogonal directions, producing a diamoond shape, then removes the original area before expansion, producing only the cells that were "off" in this and within 1 cell (orthogonal-only) of an "on" cell.GreasedRegion
GreasedRegion. fringe(int amount)
Takes the "on" cells in this GreasedRegion and expands them by amount cells in the 4 orthogonal directions (iteratively, producing a diamond shape), then removes the original area before expansion, producing only the cells that were "off" in this and within amount cells (orthogonal-only) of an "on" cell.GreasedRegion
GreasedRegion. fringe8way()
GreasedRegion
GreasedRegion. fringe8way(int amount)
GreasedRegion[]
GreasedRegion. fringeSeries(int amount)
Takes the "on" cells in this GreasedRegion and produces amount GreasedRegions, each one expanded by 1 cell in the 4 orthogonal directions relative to the previous GreasedRegion, making each "on" cell take up a diamond- shaped area.GreasedRegion[]
GreasedRegion. fringeSeries8way(int amount)
GreasedRegion
GreasedRegion. getExternalBorder()
Gets a Collection of Coord values that are not in this GreasedRegion, but are adjacent to it, either orthogonally or diagonally.GreasedRegion
GreasedRegion. getInternalBorder()
GreasedRegion
GreasedRegion. insert(int tight)
Sets the given cell, "tightly" encoded for a specific width/height as byasTightEncoded()
, to "on".GreasedRegion
GreasedRegion. insert(int x, int y)
Sets the cell at x,y to "on".GreasedRegion
GreasedRegion. insert(int x, int y, GreasedRegion other)
Takes another GreasedRegion, called other, with potentially different size and inserts its "on" cells into thi GreasedRegion at the given x,y offset, allowing negative x and/or y to put only part of other in this.GreasedRegion
GreasedRegion. insert(Coord point)
Sets the cell at point to "on".GreasedRegion
GreasedRegion. insertCircle(Coord center, int radius)
GreasedRegion
GreasedRegion. insertRectangle(int startX, int startY, int rectangleWidth, int rectangleHeight)
GreasedRegion
GreasedRegion. insertSeveral(int[] points)
GreasedRegion
GreasedRegion. insertSeveral(Iterable<Coord> points)
GreasedRegion
GreasedRegion. insertSeveral(Coord... points)
GreasedRegion
GreasedRegion. insertTranslation(int x, int y)
Adds to this GreasedRegion with a moved set of its own "on" cells, moved to the given x and y offset.GreasedRegion
GreasedRegion. largestPart()
Finds the largest contiguous area of "on" cells in this GreasedRegion and returns it; does not modify this GreasedRegion.GreasedRegion
GreasedRegion. largestPart8way()
Finds the largest contiguous area of "on" cells in this GreasedRegion and returns it; does not modify this GreasedRegion.GreasedRegion
GreasedRegion. mirrorY()
Returns a new GreasedRegion that has been mirrored along the rightmost edge, parallel to the y-axis.GreasedRegion
GreasedRegion. mixedRandomRegion(double fraction)
Modifies this GreasedRegion so it contains a deterministic but random-seeming subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. mixedRandomRegion(double fraction, int limit)
Modifies this GreasedRegion so it contains a deterministic but random-seeming subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. mixedRandomRegion(double fraction, int limit, long seed)
Modifies this GreasedRegion so it contains a deterministic but random-seeming subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. neighborDown()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor downwards when this is called.GreasedRegion
GreasedRegion. neighborDownLeft()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor downwards and to the left when this is called.GreasedRegion
GreasedRegion. neighborDownRight()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor downwards and to the right when this is called.GreasedRegion
GreasedRegion. neighborLeft()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor to the left when this is called.GreasedRegion
GreasedRegion. neighborRight()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor to the right when this is called.GreasedRegion
GreasedRegion. neighborUp()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor upwards when this is called.GreasedRegion
GreasedRegion. neighborUpLeft()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor upwards and to the left when this is called.GreasedRegion
GreasedRegion. neighborUpRight()
Modifies this GreasedRegion so the only cells that will be "on" have a neighbor upwards and to the right when this is called.GreasedRegion
GreasedRegion. not()
Negates this GreasedRegion, turning "on" to "off" and "off" to "on."GreasedRegion
GreasedRegion. notAnd(GreasedRegion other)
Like andNot, but subtracts this GreasedRegion from other and stores the result in this GreasedRegion, without mutating other.static GreasedRegion
GreasedRegion. of(int width, int height, long... data)
Constructs a GreasedRegion using a vararg for data.GreasedRegion
GreasedRegion. or(GreasedRegion other)
Union of two GreasedRegions, assigning the result into this GreasedRegion.GreasedRegion
GreasedRegion. quasiRandomRegion(double fraction)
Modifies this GreasedRegion so it contains a quasi-random subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. quasiRandomRegion(double fraction, int limit)
Modifies this GreasedRegion so it contains a quasi-random subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. randomRegion(IRNG rng, int size)
GreasedRegion
GreasedRegion. randomScatter(IRNG rng, int minimumDistance)
Modifies this GreasedRegion so it contains a random subset of its previous contents, choosing cells so that the distance between any two "on" cells is at leastminimumDistance
, with at least one cell as "on" if any were "on" in this originally.GreasedRegion
GreasedRegion. randomScatter(IRNG rng, int minimumDistance, int limit)
Modifies this GreasedRegion so it contains a random subset of its previous contents, choosing cells so that the distance between any two "on" cells is at leastminimumDistance
, with at least one cell as "on" if any were "on" in this originally.GreasedRegion
GreasedRegion. refill(boolean[][] map)
Reassigns this GreasedRegion with the given rectangular boolean array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(boolean[] bits, int width, int height)
Reassigns this GreasedRegion with the given 1D boolean array, reusing the current data storage (without extra allocations) if this.width == width and this.height == height, where an [x][y] position is obtained from bits given an index n with x = n / height, y = n % height, any value of true considered "on", and any value of false considered "off."GreasedRegion
GreasedRegion. refill(byte[][] map, int lower, int upper)
Reassigns this GreasedRegion with the given rectangular byte array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(char[][] map, char yes)
Reassigns this GreasedRegion with the given rectangular char array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(char[][] map, char[] yes)
Reassigns this GreasedRegion with the given rectangular char array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(double[][] map, double upperBound)
Reassigns this GreasedRegion with the given rectangular double array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(double[][] map, double lower, double upper)
Reassigns this GreasedRegion with the given rectangular double array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(double[][] map, double lowerBound, double upperBound, int scale)
Reassigns this GreasedRegion with the given rectangular double array, reusing the current data storage (without extra allocations) ifthis.width == map.length * scale && this.height == map[0].length * scale
.GreasedRegion
GreasedRegion. refill(int[][] map, int yes)
Reassigns this GreasedRegion with the given rectangular int array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(int[][] map, int lower, int upper)
Reassigns this GreasedRegion with the given rectangular int array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(long[] data2, int dataWidth, int dataHeight, int width, int height)
Primarily for internal use, this method copies data2 into the internal long array the new GreasedRegion will use, but treats data2 as having the dimensions [dataWidth][dataHeight], and uses the potentially-different dimensions [width][height] for this GreasedRegion, potentially re-allocating the internal data this uses if width and/or height are different from what they were.GreasedRegion
GreasedRegion. refill(short[][] map, int lower, int upper)
Reassigns this GreasedRegion with the given rectangular short array, reusing the current data storage (without extra allocations) if this.width == map.length and this.height == map[0].length.GreasedRegion
GreasedRegion. refill(String[] map, char yes)
Weird refill method that takes a String array, _as it would be printed_, so each String is a row and indexing would be done with y, x instead of the normal x, y.GreasedRegion
GreasedRegion. refill(IRNG random, int width, int height)
Reassigns this GreasedRegion by filling it with random values from random, reusing the current data storage (without extra allocations) if this.width == width and this.height == height, and typically assigning approximately half of the cells in this to "on" and the rest to off.GreasedRegion
GreasedRegion. refill(RandomnessSource random, double fraction, int width, int height)
Reassigns this GreasedRegion randomly, reusing the current data storage (without extra allocations) if this.width == width and this.height == height, while trying to set the given fraction of cells to on.GreasedRegion
GreasedRegion. refill(RandomnessSource random, int width, int height)
Reassigns this GreasedRegion by filling it with random values from random, reusing the current data storage (without extra allocations) if this.width == width and this.height == height, and typically assigning approximately half of the cells in this to "on" and the rest to off.GreasedRegion
GreasedRegion. remake(GreasedRegion other)
A useful method for efficiency, remake() reassigns this GreasedRegion to have its contents replaced by other.GreasedRegion
GreasedRegion. remove(int x, int y)
GreasedRegion
GreasedRegion. remove(int x, int y, GreasedRegion other)
Takes another GreasedRegion, called other, with potentially different size and removes its "on" cells from this GreasedRegion at the given x,y offset, allowing negative x and/or y to remove only part of other in this.GreasedRegion
GreasedRegion. remove(Coord point)
GreasedRegion
GreasedRegion. removeCircle(Coord center, int radius)
GreasedRegion
GreasedRegion. removeCorners()
Where a cell is "on" but forms a right-angle with exactly two orthogonally-adjacent "on" cells and exactly two orthogonally-adjacent "off" cells, this turns each of those cells "off." This won't affect east-west lines of flat "on" cells, nor north-south lines.GreasedRegion
GreasedRegion. removeEdges()
Turns all cells that are adjacent to the boundaries of the GreasedRegion to "off".GreasedRegion
GreasedRegion. removeIsolated()
GreasedRegion
GreasedRegion. removeRectangle(int startX, int startY, int rectangleWidth, int rectangleHeight)
Removes all "on" cells from (startX, startY) inclusive to (startX+rectangleWidth, startY+rectangleHeight) exclusive, removing a total width of rectangleWidth and a total height of rectangleHeight in cells.GreasedRegion
GreasedRegion. removeSeveral(Iterable<Coord> points)
GreasedRegion
GreasedRegion. removeSeveral(Coord... points)
GreasedRegion
GreasedRegion. resizeAndEmpty(int width, int height)
If this GreasedRegion has the same width and height passed as parameters, this acts the same asempty()
, makes no allocations, and returns this GreasedRegion with its contents all "off"; otherwise, this does allocate a differently-sized amount of internal data to match the new width and height, sets the fields to all match the new width and height, and returns this GreasedRegion with its new width and height, with all contents "off".GreasedRegion
GreasedRegion. retract()
Takes the "on" cells in this GreasedRegion and retracts them by one cell in the 4 orthogonal directions, making each "on" cell that was orthogonally adjacent to an "off" cell into an "off" cell.GreasedRegion
GreasedRegion. retract(int amount)
Takes the "on" cells in this GreasedRegion and retracts them by one cell in the 4 orthogonal directions, doing this iteeratively amount times, making each "on" cell that was within amount orthogonal distance to an "off" cell into an "off" cell.GreasedRegion
GreasedRegion. retract8way()
GreasedRegion
GreasedRegion. retract8way(int amount)
GreasedRegion[]
GreasedRegion. retractSeries(int amount)
GreasedRegion[]
GreasedRegion. retractSeries8way(int amount)
GreasedRegion
BalancedPermutations. rotatedGrid()
GreasedRegion
CellularAutomaton. runBasicSmoothing()
Reduces the sharpness of corners by only considering a cell on if the previous version has 5 of the 9 cells in the containing 3x3 area as "on." Typically, this method is run repeatedly.GreasedRegion
CellularAutomaton. runDiagonalGapCleanup()
This takes theCellularAutomaton.current
GreasedRegion and removes any cells that have a diagonal neighbor if that neighbor cannot be accessed from shared orthogonal neighbors.GreasedRegion
CellularAutomaton. runGameOfLife()
Runs one step of the simulation called Conway's Game of Life, which has relatively simple rules: Any "on" cell with fewer than two "on" neighbors becomes "off." Any "on" cell with two or three "on" neighbors (no more than three) stays "on." Any "on" cell with more than three "on" neighbors becomes "off." Any "off" cell with exactly three "on" neighbors becomes "on." These rules can bring about complex multi-step patterns in many cases, eventually stabilizing to predictable patterns in most cases.GreasedRegion
GreasedRegion. separatedRegionBlue(double fraction)
Modifies this GreasedRegion so it contains a quasi-random subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. separatedRegionBlue(double fraction, int limit)
Modifies this GreasedRegion so it contains a quasi-random subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. separatedRegionZCurve(double fraction)
Modifies this GreasedRegion so it contains a quasi-random subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. separatedRegionZCurve(double fraction, int limit)
Modifies this GreasedRegion so it contains a quasi-random subset of its previous contents, choosing cells so that thesize()
matches the givenfraction
of the total amount of "on" cells in this.GreasedRegion
GreasedRegion. set(boolean value, int x, int y)
Sets the cell at x,y to on if value is true or off if value is false.GreasedRegion
GreasedRegion. set(boolean value, Coord point)
Sets the cell at point to on if value is true or off if value is false.GreasedRegion
BalancedPermutations. shuffledGrid()
GreasedRegion
BalancedPermutations. shuffledGridMultiple(int repeats)
GreasedRegion
GreasedRegion. spill(GreasedRegion bounds, int volume, IRNG rng)
A randomized flood-fill that modifies this GreasedRegion so it randomly adds adjacent cells while staying inside the "on" cells ofbounds
, untilsize()
is equal tovolume
or there are no more cells this can expand into.GreasedRegion
GreasedRegion. surface()
GreasedRegion
GreasedRegion. surface(int amount)
GreasedRegion
GreasedRegion. surface8way()
GreasedRegion
GreasedRegion. surface8way(int amount)
GreasedRegion[]
GreasedRegion. surfaceSeries(int amount)
GreasedRegion[]
GreasedRegion. surfaceSeries8way(int amount)
GreasedRegion
GreasedRegion. thin()
Likeretract()
, this reduces the width of thick areas of this GreasedRegion, but thin() will not remove areas that would be identical in a subsequent call to retract(), such as if the area would be eliminated.GreasedRegion
GreasedRegion. thin8way()
Likeretract8way()
, this reduces the width of thick areas of this GreasedRegion, but thin8way() will not remove areas that would be identical in a subsequent call to retract8way(), such as if the area would be eliminated.GreasedRegion
GreasedRegion. thinFully()
Callsthin()
repeatedly, until the result is unchanged from the last call.GreasedRegion
GreasedRegion. thinFully8way()
Callsthin8way()
repeatedly, until the result is unchanged from the last call.GreasedRegion
GreasedRegion. toggle(int x, int y)
Changes the on/off state of the cell with the given x and y, making an on cell into an off cell, or an off cell into an on cell.GreasedRegion
GreasedRegion. translate(int x, int y)
Moves the "on" cells in this GreasedRegion to the given x and y offset, removing cells that move out of bounds.GreasedRegion
GreasedRegion. translate(Coord c)
Translates a copy ofthis
by the x,y values inc
.static GreasedRegion
CoordPacker. unpackGreasedRegion(short[] packed, int width, int height)
Utility method that constructs a GreasedRegion (a faster but more-memory-hungry way to encode regions) from a short array of packed data.static GreasedRegion
CoordPacker. unpackIntoGreasedRegion(short[] packed, GreasedRegion target)
Utility method that fills an existing GreasedRegiontarget
with any "on" cells in the packed short arraypacked
.static GreasedRegion
CoordPacker. unpackIntoGreasedRegion(short[] packed, GreasedRegion target, int offsetX, int offsetY)
Utility method that fills an existing GreasedRegiontarget
with any "on" cells in the packed short arraypacked
, inserting cells from packed at an offset when they go into target.GreasedRegion
GreasedRegion. xor(GreasedRegion other)
Symmetric difference (more commonly known as exclusive or, hence the name) of two GreasedRegions, assigning the result into this GreasedRegion.GreasedRegion
GreasedRegion. zoom(int x, int y)
Effectively doubles the x and y values of each cell this contains (not scaling each cell to be larger, so each "on" cell will be surrounded by "off" cells), and re-maps the positions so the given x and y in the doubled space become 0,0 in the resulting GreasedRegion (which is this, assigning to itself).Methods in squidpony.squidmath that return types with arguments of type GreasedRegion Modifier and Type Method Description static Collection<GreasedRegion>
GreasedRegion. appendContaining(Collection<GreasedRegion> into, int x, int y, Collection<GreasedRegion> packed)
Tries to look up the position x,y in each GreasedRegion in packed; each GreasedRegion that contains that x,y point is appended into the Collectioninto
.static Collection<GreasedRegion>
GreasedRegion. appendContaining(Collection<GreasedRegion> into, int x, int y, GreasedRegion... packed)
Tries to look up the position x,y in each GreasedRegion in packed; each GreasedRegion that contains that x,y point is appended into the Collectioninto
.ArrayList<GreasedRegion>
GreasedRegion. expandSeriesToLimit()
ArrayList<GreasedRegion>
GreasedRegion. expandSeriesToLimit8way()
ArrayList<GreasedRegion>
GreasedRegion. floodSeriesToLimit(GreasedRegion bounds)
Repeatedly generates new GreasedRegions, each one cell expanded in 4 directions from the previous GreasedRegion and staying inside the "on" cells ofbounds
, until it can't expand any more.ArrayList<GreasedRegion>
GreasedRegion. floodSeriesToLimit8way(GreasedRegion bounds)
Repeatedly generates new GreasedRegions, each one cell expanded in 8 directions from the previous GreasedRegion and staying inside the "on" cells ofbounds
, until it can't expand any more.ArrayList<GreasedRegion>
GreasedRegion. fringeSeriesToLimit()
ArrayList<GreasedRegion>
GreasedRegion. fringeSeriesToLimit8way()
ArrayList<GreasedRegion>
GreasedRegion. retractSeriesToLimit()
ArrayList<GreasedRegion>
GreasedRegion. retractSeriesToLimit8way()
ArrayList<GreasedRegion>
GreasedRegion. split()
If this GreasedRegion stores multiple unconnected "on" areas, this finds each isolated area (areas that are only adjacent diagonally are considered separate from each other) and returns it as an element in an ArrayList of GreasedRegion, with one GreasedRegion per isolated area.ArrayList<GreasedRegion>
GreasedRegion. split8way()
If this GreasedRegion stores multiple unconnected "on" areas, this finds each isolated area (areas that are only adjacent diagonally are considered one area with this) and returns it as an element in an ArrayList of GreasedRegion, with one GreasedRegion per isolated area.ArrayList<GreasedRegion>
GreasedRegion. surfaceSeriesToLimit()
ArrayList<GreasedRegion>
GreasedRegion. surfaceSeriesToLimit8way()
static OrderedSet<GreasedRegion>
GreasedRegion. whichContain(int x, int y, Collection<GreasedRegion> packed)
static OrderedSet<GreasedRegion>
GreasedRegion. whichContain(int x, int y, GreasedRegion... packed)
Methods in squidpony.squidmath with parameters of type GreasedRegion Modifier and Type Method Description GreasedRegion
GreasedRegion. and(GreasedRegion other)
Intersection of two GreasedRegions, assigning the result into this GreasedRegion.GreasedRegion
GreasedRegion. andNot(GreasedRegion other)
Difference of two GreasedRegions, assigning the result into this GreasedRegion.GreasedRegion
GreasedRegion. andWrapping64(GreasedRegion other)
Intersection of two GreasedRegions, assigning the result into this GreasedRegion, with the special requirement that other must be a 64x64 area, and the special property that other will be considered tiled to cover all of the area of this GreasedRegion.static Collection<GreasedRegion>
GreasedRegion. appendContaining(Collection<GreasedRegion> into, int x, int y, GreasedRegion... packed)
Tries to look up the position x,y in each GreasedRegion in packed; each GreasedRegion that contains that x,y point is appended into the Collectioninto
.static int[][]
GreasedRegion. bitSum(GreasedRegion... regions)
Generates a 2D int array from an array or vararg of GreasedRegions, treating each cell in the nth region as the nth bit of the int at the corresponding x,y cell in the int array.GreasedRegion
GreasedRegion. flood(GreasedRegion bounds)
Likeexpand()
, but limits expansion to the "on" cells ofbounds
.GreasedRegion
GreasedRegion. flood(GreasedRegion bounds, int amount)
Likeexpand(int)
, but limits expansion to the "on" cells ofbounds
.GreasedRegion
GreasedRegion. flood8way(GreasedRegion bounds)
Likeexpand8way()
, but limits expansion to the "on" cells ofbounds
.GreasedRegion
GreasedRegion. flood8way(GreasedRegion bounds, int amount)
Likeexpand8way(int)
, but limits expansion to the "on" cells ofbounds
.GreasedRegion[]
GreasedRegion. floodSeries(GreasedRegion bounds, int amount)
Repeatedly callsflood(GreasedRegion)
amount
times and returns the intermediate steps in a GreasedRegion array of sizeamount
.GreasedRegion[]
GreasedRegion. floodSeries8way(GreasedRegion bounds, int amount)
Repeatedly callsflood8way(GreasedRegion)
amount
times and returns the intermediate steps in a GreasedRegion array of sizeamount
.ArrayList<GreasedRegion>
GreasedRegion. floodSeriesToLimit(GreasedRegion bounds)
Repeatedly generates new GreasedRegions, each one cell expanded in 4 directions from the previous GreasedRegion and staying inside the "on" cells ofbounds
, until it can't expand any more.ArrayList<GreasedRegion>
GreasedRegion. floodSeriesToLimit8way(GreasedRegion bounds)
Repeatedly generates new GreasedRegions, each one cell expanded in 8 directions from the previous GreasedRegion and staying inside the "on" cells ofbounds
, until it can't expand any more.GreasedRegion
GreasedRegion. insert(int x, int y, GreasedRegion other)
Takes another GreasedRegion, called other, with potentially different size and inserts its "on" cells into thi GreasedRegion at the given x,y offset, allowing negative x and/or y to put only part of other in this.boolean
GreasedRegion. intersects(GreasedRegion other)
Returns true if any cell is "on" in both this GreasedRegion and in other; returns false otherwise.GreasedRegion
GreasedRegion. notAnd(GreasedRegion other)
Like andNot, but subtracts this GreasedRegion from other and stores the result in this GreasedRegion, without mutating other.GreasedRegion
GreasedRegion. or(GreasedRegion other)
Union of two GreasedRegions, assigning the result into this GreasedRegion.CellularAutomaton
CellularAutomaton. remake(GreasedRegion next)
Re-initializes this CellularAutomaton using a different GreasedRegion as a basis.GreasedRegion
GreasedRegion. remake(GreasedRegion other)
A useful method for efficiency, remake() reassigns this GreasedRegion to have its contents replaced by other.GreasedRegion
GreasedRegion. remove(int x, int y, GreasedRegion other)
Takes another GreasedRegion, called other, with potentially different size and removes its "on" cells from this GreasedRegion at the given x,y offset, allowing negative x and/or y to remove only part of other in this.GreasedRegion
GreasedRegion. spill(GreasedRegion bounds, int volume, IRNG rng)
A randomized flood-fill that modifies this GreasedRegion so it randomly adds adjacent cells while staying inside the "on" cells ofbounds
, untilsize()
is equal tovolume
or there are no more cells this can expand into.static int[][]
GreasedRegion. sum(GreasedRegion... regions)
Generates a 2D int array from an array or vararg of GreasedRegions, starting at all 0 and adding 1 to the int at a position once for every GreasedRegion that has that cell as "on." This means if you give 8 GreasedRegions to this method, it can produce any number between 0 and 8 in a cell; if you give 16 GreasedRegions, then it can produce any number between 0 and 16 in a cell.static double[][]
GreasedRegion. sumDouble(GreasedRegion... regions)
Generates a 2D double array from an array or vararg of GreasedRegions, starting at all 0 and adding 1 to the double at a position once for every GreasedRegion that has that cell as "on." This means if you give 8 GreasedRegions to this method, it can produce any number between 0 and 8 in a cell; if you give 16 GreasedRegions, then it can produce any number between 0 and 16 in a cell.static int[][]
GreasedRegion. sumInto(int[][] existing, GreasedRegion... regions)
Adds to an existing 2D int array with an array or vararg of GreasedRegions, adding 1 to the int in existing at a position once for every GreasedRegion that has that cell as "on." This means if you give 8 GreasedRegions to this method, it can increment by any number between 0 and 8 in a cell; if you give 16 GreasedRegions, then it can increase the value in existing by any number between 0 and 16 in a cell.static double[][]
GreasedRegion. sumIntoDouble(double[][] existing, GreasedRegion... regions)
Adds to an existing 2D double array with an array or vararg of GreasedRegions, adding 1 to the double in existing at a position once for every GreasedRegion that has that cell as "on." This means if you give 8 GreasedRegions to this method, it can increment by any number between 0 and 8 in a cell; if you give 16 GreasedRegions, then it can increase the value in existing by any number between 0 and 16 in a cell.static int[][]
GreasedRegion. sumWeighted(GreasedRegion[] regions, int[] weights)
Generates a 2D int array from an array of GreasedRegions and an array of weights, starting the 2D result at all 0 and, for every GreasedRegion that has that cell as "on," adding the int in the corresponding weights array at the position of that cell.static double[][]
GreasedRegion. sumWeightedDouble(GreasedRegion[] regions, double[] weights)
Generates a 2D double array from an array of GreasedRegions and an array of weights, starting the 2D result at all 0 and, for every GreasedRegion that has that cell as "on," adding the double in the corresponding weights array at the position of that cell.static GreasedRegion
CoordPacker. unpackIntoGreasedRegion(short[] packed, GreasedRegion target)
Utility method that fills an existing GreasedRegiontarget
with any "on" cells in the packed short arraypacked
.static GreasedRegion
CoordPacker. unpackIntoGreasedRegion(short[] packed, GreasedRegion target, int offsetX, int offsetY)
Utility method that fills an existing GreasedRegiontarget
with any "on" cells in the packed short arraypacked
, inserting cells from packed at an offset when they go into target.static OrderedSet<GreasedRegion>
GreasedRegion. whichContain(int x, int y, GreasedRegion... packed)
GreasedRegion
GreasedRegion. xor(GreasedRegion other)
Symmetric difference (more commonly known as exclusive or, hence the name) of two GreasedRegions, assigning the result into this GreasedRegion.Method parameters in squidpony.squidmath with type arguments of type GreasedRegion Modifier and Type Method Description static Collection<GreasedRegion>
GreasedRegion. appendContaining(Collection<GreasedRegion> into, int x, int y, Collection<GreasedRegion> packed)
Tries to look up the position x,y in each GreasedRegion in packed; each GreasedRegion that contains that x,y point is appended into the Collectioninto
.static Collection<GreasedRegion>
GreasedRegion. appendContaining(Collection<GreasedRegion> into, int x, int y, GreasedRegion... packed)
Tries to look up the position x,y in each GreasedRegion in packed; each GreasedRegion that contains that x,y point is appended into the Collectioninto
.static int[][]
GreasedRegion. sum(List<GreasedRegion> regions)
Generates a 2D int array from a List of GreasedRegions, starting at all 0 and adding 1 to the int at a position once for every GreasedRegion that has that cell as "on." This means if you give 8 GreasedRegions to this method, it can produce any number between 0 and 8 in a cell; if you give 16 GreasedRegions, then it can produce any number between 0 and 16 in a cell.static double[][]
GreasedRegion. sumDouble(List<GreasedRegion> regions)
Generates a 2D double array from a List of GreasedRegions, starting at all 0 and adding 1 to the double at a position once for every GreasedRegion that has that cell as "on." This means if you give 8 GreasedRegions to this method, it can produce any number between 0 and 8 in a cell; if you give 16 GreasedRegions, then it can produce any number between 0 and 16 in a cell.static OrderedSet<GreasedRegion>
GreasedRegion. whichContain(int x, int y, Collection<GreasedRegion> packed)
Constructors in squidpony.squidmath with parameters of type GreasedRegion Constructor Description CellularAutomaton(GreasedRegion current)
Stores a direct reference tocurrent
as this object'sCellularAutomaton.current
field, and initializes the other necessary fields.GreasedRegion(GreasedRegion other)
Copy constructor that takes another GreasedRegion and copies all of its data into this new one.