public enum Radius extends Enum<Radius>
Enum Constant and Description |
---|
CIRCLE
In an unobstructed area the FOV would be a circle.
|
CUBE
In an unobstructed area the FOV would be a cube.
|
DIAMOND
In an unobstructed area the FOV would be a diamond.
|
OCTAHEDRON
In an unobstructed area the FOV would be a octahedron.
|
SPHERE
In an unobstructed area the FOV would be a sphere.
|
SQUARE
In an unobstructed area the FOV would be a square.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals2D(Radius other)
Compares two Radius enums as if they are both in a 2D plane; that is, Radius.SPHERE is treated as equal to
Radius.CIRCLE, Radius.CUBE is equal to Radius.SQUARE, and Radius.OCTAHEDRON is equal to Radius.DIAMOND.
|
Set<Coord> |
expand(int distance,
int width,
int height,
Iterable<Coord> points)
Given an Iterable of Coord (such as a List or Set), a distance to expand outward by (using this Radius), and the
bounding height and width of the map, gets a "thickened" group of Coord as a Set where each Coord in points has
been expanded out by an amount no greater than distance.
|
Coord |
extend(Coord center,
Coord middle,
int radiusLength,
boolean surpassEdges,
int width,
int height) |
boolean |
inRange(int startx,
int starty,
int endx,
int endy,
int minRange,
int maxRange) |
Coord |
onUnitShape(double distance,
RNG rng) |
Coord3D |
onUnitShape3D(double distance,
RNG rng) |
Set<Coord> |
perimeter(Coord center,
int radiusLength,
boolean surpassEdges,
int width,
int height) |
Set<Coord> |
pointsInside(Coord center,
int radiusLength,
boolean surpassEdges,
int width,
int height) |
double |
radius(Coord end) |
double |
radius(Coord start,
Coord end) |
double |
radius(double dx,
double dy) |
double |
radius(double dx,
double dy,
double dz) |
double |
radius(double startx,
double starty,
double endx,
double endy) |
double |
radius(double startx,
double starty,
double startz,
double endx,
double endy,
double endz) |
double |
radius(int dx,
int dy) |
double |
radius(int dx,
int dy,
int dz) |
double |
radius(int startx,
int starty,
int endx,
int endy) |
double |
radius(int startx,
int starty,
int startz,
int endx,
int endy,
int endz) |
int |
roughDistance(int xPos,
int yPos) |
static Radius |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Radius[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
double |
volume2D(double radiusLength) |
double |
volume3D(double radiusLength) |
public static final Radius SQUARE
public static final Radius DIAMOND
public static final Radius CIRCLE
public static final Radius CUBE
public static final Radius OCTAHEDRON
public static Radius[] values()
for (Radius c : Radius.values()) System.out.println(c);
public static Radius valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic double radius(int startx, int starty, int startz, int endx, int endy, int endz)
public double radius(double startx, double starty, double startz, double endx, double endy, double endz)
public double radius(int dx, int dy, int dz)
public double radius(double dx, double dy, double dz)
public double radius(int startx, int starty, int endx, int endy)
public double radius(double startx, double starty, double endx, double endy)
public double radius(int dx, int dy)
public double radius(double dx, double dy)
public Coord onUnitShape(double distance, RNG rng)
public Coord3D onUnitShape3D(double distance, RNG rng)
public double volume2D(double radiusLength)
public double volume3D(double radiusLength)
public Set<Coord> perimeter(Coord center, int radiusLength, boolean surpassEdges, int width, int height)
public Coord extend(Coord center, Coord middle, int radiusLength, boolean surpassEdges, int width, int height)
public boolean equals2D(Radius other)
other
- the Radius to compare this topublic boolean inRange(int startx, int starty, int endx, int endy, int minRange, int maxRange)
public int roughDistance(int xPos, int yPos)
public Set<Coord> pointsInside(Coord center, int radiusLength, boolean surpassEdges, int width, int height)
public Set<Coord> expand(int distance, int width, int height, Iterable<Coord> points)
distance
- the distance, as measured by this Radius, to expand each Coord on points up towidth
- the bounding width of the map (exclusive)height
- the bounding height of the map (exclusive)points
- an Iterable (such as a List or Set) of Coord that this will make a "thickened" version ofCopyright © 2012–2016. All rights reserved.