public class Reach
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
AimLimit |
limit
An AimLimit enum that may be used to determine limitations to targeting cells; defaults to FREE (no limits other
than those from distance), but can also be set to ORTHOGONAL (rook move in chess), DIAGONAL (bishop move in
chess), EIGHT_WAY (queen or king move in chess), or null (which usually)
|
int |
maxDistance
The maximum distance in cells that this Reach can target.
|
Radius |
metric
Determines how distance will be measured.
|
int |
minDistance
The minimum distance in cells that this Reach can target.
|
Constructor and Description |
---|
Reach()
Constructs a Reach with all fields given default values; maxDistance is set to 1, minDistance is set to 0, limit
is set to AimLimit.FREE, and metric is set to Radius.SQUARE (8-way movement).
|
Reach(int maxDistance)
Constructs a Reach with the specified maxDistance, to a minimum of 0.
|
Reach(int minDistance,
int maxDistance)
Constructs a Reach with the specified minDistance, to a minimum of 0, and maxDistance, to a minimum equal to
minDistance (after factoring in any change to meet the minimum of 0).
|
Reach(int minDistance,
int maxDistance,
Radius metric)
Constructs a Reach with the specified minDistance, to a minimum of 0, maxDistance, to a minimum equal to
minDistance (after factoring in any change to meet the minimum of 0), and distance calculation metric as a Radius
enum.
|
Reach(int minDistance,
int maxDistance,
Radius metric,
AimLimit limit)
Constructs a Reach with the specified minDistance, to a minimum of 0, maxDistance, to a minimum equal to
minDistance (after factoring in any change to meet the minimum of 0), and distance calculation metric as a Radius
enum.
|
public int minDistance
metric
field.public int maxDistance
metric
field.public AimLimit limit
public Radius metric
public Reach()
public Reach(int maxDistance)
maxDistance
- the longest distance in cells this Reach can target; will be set to 0 if negativepublic Reach(int minDistance, int maxDistance)
minDistance
- the shortest distance in cells this Reach can target; will be set to 0 if negativemaxDistance
- the longest distance in cells this Reach can target; will be set to the final value of
minDistance if it is lower than the calculated minDistancepublic Reach(int minDistance, int maxDistance, Radius metric)
minDistance
- the shortest distance in cells this Reach can target; will be set to 0 if negativemaxDistance
- the longest distance in cells this Reach can target; will be set to the final value of
minDistance if it is lower than the calculated minDistancemetric
- a Radius enum that determines how distance will be calculatedpublic Reach(int minDistance, int maxDistance, Radius metric, AimLimit limit)
minDistance
- the shortest distance in cells this Reach can target; will be set to 0 if negativemaxDistance
- the longest distance in cells this Reach can target; will be set to the final value of
minDistance if it is lower than the calculated minDistancemetric
- a Radius enum that determines how distance will be calculatedlimit
- an AimLimit enum that can be used to limit targeting to specific angles, or not at all (if null or
equal to AimLimit.FREE)Copyright © Eben Howard 2012–2022. All rights reserved.