public class FOVTranslator extends java.lang.Object implements FOVSolver
Constructor and Description |
---|
FOVTranslator(FOVSolver solver)
Creates an empty instance.
|
Modifier and Type | Method and Description |
---|---|
boolean[][] |
calculateFOV(boolean[][] map,
int startx,
int starty,
float radius)
Calculates the FOV using a boolean array where true indicates that the
location blocks all light.
|
boolean[][] |
calculateFOV(boolean[][] map,
int startx,
int starty,
float force,
float decay,
RadiusStrategy radiusStrategy)
Calculates the FOV using a boolean array where true indicates that the
location blocks all light.
|
float[][] |
calculateFOV(float[][] map,
int startx,
int starty,
float radius)
Calculates the Field of View in the same manner as the version with more
parameters.
|
float[][] |
calculateFOV(float[][] map,
int startx,
int starty,
float force,
float decay,
RadiusStrategy radiusStrategy)
Calculates the Field Of View for the provided map from the given x, y
coordinates.
|
int[][] |
calculateFOV(int[][] map,
int startx,
int starty,
float radius,
float scale)
Calculates the FOV using an integer array.
|
int[][] |
calculateFOV(int[][] map,
int startx,
int starty,
float force,
float decay,
RadiusStrategy radiusStrategy,
float scale)
Calculates the FOV using an integer array.
|
boolean[][] |
getBooleanArray()
Returns the last calculated light map as a boolean 2d array.
|
int |
getInt(int x,
int y,
int scale)
Returns the scaled value at (x, y).
|
int[][] |
getIntArray(float scale)
Returns an integer array representation of the last calculated FOV light
map.
|
boolean |
isLit(int x,
int y)
Returns true if the cell at (x, y) is considered lit.
|
public FOVTranslator(FOVSolver solver)
public float[][] calculateFOV(float[][] map, int startx, int starty, float force, float decay, RadiusStrategy radiusStrategy)
FOVSolver
calculateFOV
in interface FOVSolver
map
- the grid of cells to calculate onstartx
- the horizontal component of the starting locationstarty
- the vertical component of the starting locationforce
- the power of the raydecay
- how much the light is reduced for each whole integer step in
distanceradiusStrategy
- provides a means to calculate the radius as desiredpublic float[][] calculateFOV(float[][] map, int startx, int starty, float radius)
FOVSolver
calculateFOV
in interface FOVSolver
map
- the grid of cells to calculate onpublic int[][] calculateFOV(int[][] map, int startx, int starty, float force, float decay, RadiusStrategy radiusStrategy, float scale)
map
- startx
- starty
- force
- decay
- radiusStrategy
- scale
- public int[][] calculateFOV(int[][] map, int startx, int starty, float radius, float scale)
map
- startx
- starty
- radius
- scale
- public boolean[][] calculateFOV(boolean[][] map, int startx, int starty, float force, float decay, RadiusStrategy radiusStrategy)
map
- startx
- starty
- force
- decay
- radiusStrategy
- public boolean[][] calculateFOV(boolean[][] map, int startx, int starty, float radius)
map
- startx
- starty
- radius
- public boolean[][] getBooleanArray()
public int[][] getIntArray(float scale)
multiplyer
- public boolean isLit(int x, int y)
x
- y
- public int getInt(int x, int y, int scale)
x
- y
- scale
-