Package squidpony.squidgrid
Class Adjacency.RotationAdjacency
java.lang.Object
squidpony.squidgrid.Adjacency
squidpony.squidgrid.Adjacency.RotationAdjacency
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Adjacency
public static class Adjacency.RotationAdjacency extends Adjacency implements Serializable
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class squidpony.squidgrid.Adjacency
Adjacency.BasicAdjacency, Adjacency.RotationAdjacency, Adjacency.ThinWallAdjacency -
Field Summary
Fields inherited from class squidpony.squidgrid.Adjacency
blockingRule, costRules, depths, directions, height, invertAdjacent, maxAdjacent, measurement, rotations, standardCost, twoStepRule, width -
Constructor Summary
Constructors Constructor Description RotationAdjacency(int width, int height, Measurement metric) -
Method Summary
Modifier and Type Method Description IntDoubleOrderedMapaddCostRule(char tile, double cost, boolean isRotation)intcomposite(int x, int y, int r, int n)Encodes up to four components used by this Adjacency, putting them into one int.intextractN(int data)intextractR(int data)intextractX(int data)intextractY(int data)booleanisBlocked(int start, int direction, int[][][] neighbors, double[] map, double wall)int[][][]neighborMaps()voidportal(int[][][] neighbors, int inputPortal, int outputPortal, boolean twoWay)IntDoubleOrderedMapputAllVariants(IntDoubleOrderedMap map, int key, double value, int size)voidputAllVariants(IntVLA list, double[] map, int key, double value, int size)voidresetAllVariants(double[] map, int[] keys, int usable, double[] values, int size)booleanvalidate(int data)Methods inherited from class squidpony.squidgrid.Adjacency
addCostRule, extractCoord, hasStandardCost, move, move, putAllVariants, putAllVariants, resetAllVariants, resetAllVariants, show, showMap
-
Constructor Details
-
Method Details
-
extractX
-
extractY
-
extractR
-
extractN
-
composite
Description copied from class:AdjacencyEncodes up to four components used by this Adjacency, putting them into one int. Returns -1 if the encoded position is out of bounds or otherwise invalid, otherwise any int is possible. You can get the individual values withAdjacency.extractX(int),Adjacency.extractY(int),Adjacency.extractR(int), andAdjacency.extractN(int), though not all implementations use R and N.- Specified by:
compositein classAdjacency- Parameters:
x- the x component to encodey- the y component to encoder- the rotation component to encode; not all implementations use rotation and the max value variesn- the bonus component to encode; this can be used for height or other extra data in some implementations- Returns:
- the encoded position as an int; -1 if invalid, non-negative for valid positions
-
validate
-
neighborMaps
- Specified by:
neighborMapsin classAdjacency
-
isBlocked
-
portal
-
addCostRule
- Specified by:
addCostRulein classAdjacency
-
putAllVariants
public IntDoubleOrderedMap putAllVariants(IntDoubleOrderedMap map, int key, double value, int size)- Specified by:
putAllVariantsin classAdjacency
-
putAllVariants
- Specified by:
putAllVariantsin classAdjacency
-
resetAllVariants
- Specified by:
resetAllVariantsin classAdjacency
-