public static class Adjacency.BasicAdjacency extends Adjacency implements java.io.Serializable
Adjacency.BasicAdjacency, Adjacency.RotationAdjacency, Adjacency.ThinWallAdjacency
blockingRule, costRules, depths, directions, height, invertAdjacent, maxAdjacent, measurement, rotations, standardCost, twoStepRule, width
Constructor and Description |
---|
BasicAdjacency(int width,
int height,
Measurement metric) |
Modifier and Type | Method and Description |
---|---|
IntDoubleOrderedMap |
addCostRule(char tile,
double cost,
boolean isRotation) |
int |
composite(int x,
int y,
int r,
int n)
Encodes up to four components used by this Adjacency, putting them into one int.
|
int |
extractN(int data) |
int |
extractR(int data) |
int |
extractX(int data) |
int |
extractY(int data) |
boolean |
isBlocked(int start,
int direction,
int[][][] neighbors,
double[] map,
double wall) |
int |
move(int start,
int x,
int y) |
int[][][] |
neighborMaps() |
void |
portal(int[][][] neighbors,
int inputPortal,
int outputPortal,
boolean twoWay) |
IntDoubleOrderedMap |
putAllVariants(IntDoubleOrderedMap map,
int key,
double value,
int size) |
void |
putAllVariants(IntVLA list,
double[] map,
int key,
double value,
int size) |
void |
resetAllVariants(double[] map,
int[] keys,
int usable,
double[] values,
int size) |
boolean |
validate(int data) |
addCostRule, extractCoord, hasStandardCost, move, putAllVariants, putAllVariants, resetAllVariants, resetAllVariants, show, showMap
public BasicAdjacency(int width, int height, Measurement metric)
public int composite(int x, int y, int r, int n)
Adjacency
Adjacency.extractX(int)
, Adjacency.extractY(int)
, Adjacency.extractR(int)
,
and Adjacency.extractN(int)
, though not all implementations use R and N.composite
in class Adjacency
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 implementationspublic int[][][] neighborMaps()
neighborMaps
in class Adjacency
public boolean isBlocked(int start, int direction, int[][][] neighbors, double[] map, double wall)
public void portal(int[][][] neighbors, int inputPortal, int outputPortal, boolean twoWay)
public IntDoubleOrderedMap addCostRule(char tile, double cost, boolean isRotation)
addCostRule
in class Adjacency
public IntDoubleOrderedMap putAllVariants(IntDoubleOrderedMap map, int key, double value, int size)
putAllVariants
in class Adjacency
public void putAllVariants(IntVLA list, double[] map, int key, double value, int size)
putAllVariants
in class Adjacency
public void resetAllVariants(double[] map, int[] keys, int usable, double[] values, int size)
resetAllVariants
in class Adjacency
Copyright © Eben Howard 2012–2022. All rights reserved.