public class PointAOE extends Object implements AOE
Constructor and Description |
---|
PointAOE(Coord center) |
PointAOE(Coord center,
int minRange,
int maxRange) |
Modifier and Type | Method and Description |
---|---|
OrderedMap<Coord,Double> |
findArea()
This is how an AOE interacts with anything that uses it.
|
Coord |
getCenter() |
AimLimit |
getLimitType()
Gets the AimLimit enum that can be used to restrict points this checks (defaults to null if not set).
|
int |
getMaxRange()
The maximum inclusive range that the AOE can be shift()-ed to using the distance measurement from radiusType.
|
Radius |
getMetric()
Used to determine distance from origin for the purposes of selecting a target location that is within the bounds
of minRange and maxRange.
|
int |
getMinRange()
The minimum inclusive range that the AOE can be shift()-ed to using the distance measurement from radiusType.
|
Coord |
getOrigin()
Get the position from which the AOE originates, which may be related to the location of the AOE's effect, as for
lines, cones, and other emitted effects, or may be unrelated except for determining which enemies can be seen
or targeted from a given origin point (as for distant effects that radiate from a chosen central point, but
have a maxRange at which they can deliver that effect).
|
Reach |
getReach()
Gets the same values returned by getLimitType(), getMinRange(), getMaxRange(), and getMetric() bundled into one
Reach object.
|
OrderedMap<Coord,ArrayList<Coord>> |
idealLocations(Set<Coord> targets,
Set<Coord> requiredExclusions)
Returns a OrderedMap of Coord keys and ArrayList of Coord values, where each Coord key is an ideal location to
hit as many of the Points in targets as possible without hitting any Points in requiredExclusions, and each value
is the collection of targets that will be hit if the associated key is used.
|
OrderedMap<Coord,ArrayList<Coord>> |
idealLocations(Set<Coord> priorityTargets,
Set<Coord> lesserTargets,
Set<Coord> requiredExclusions)
A variant of idealLocations that takes two groups of desirable targets, and will rate locations by how many
priorityTargets are in the AOE, then by how many lesserTargets are in the AOE, and will only consider locations
that do not affect a Coord in requiredExclusions.
|
boolean |
mayContainTarget(Set<Coord> targets)
Given a Set of Points that the producer of the AOE wants to include in the region of this AOE, this method does
a quick approximation to see if there is any possibility that the AOE as currently configured might include one
of those Points within itself.
|
void |
setCache(FOVCache cache)
If you use FOVCache to pre-compute FOV maps for a level, you can share the speedup from using the cache with
some AOE implementations that rely on FOV.
|
void |
setCenter(Coord center) |
void |
setLimitType(AimLimit limitType)
You can use limitType to restrict any Points that might be processed based on the given origin (which will be
used as the geometric origin for any calculations this makes) with AimLimit values having the following meanings:
AimLimit.FREE makes no restrictions; it is equivalent here to passing null for limit.
AimLimit.EIGHT_WAY will only consider Points to be valid targets
if they are along a straight line with an angle that is a multiple of 45 degrees, relative to the positive x
axis.
|
void |
setMap(char[][] map)
This must be called before any other methods, and takes a char[][] with '#' for walls, anything else for floors.
|
void |
setMaxRange(int maxRange)
The maximum inclusive range that the AOE can be shift()-ed to using the distance measurement from radiusType.
|
void |
setMetric(Radius metric)
Used to determine distance from origin for the purposes of selecting a target location that is within the bounds
of minRange and maxRange.
|
void |
setMinRange(int minRange)
The minimum inclusive range that the AOE can be shift()-ed to using the distance measurement from radiusType.
|
void |
setOrigin(Coord origin)
Set the position from which the AOE originates, which may be related to the location of the AOE's effect, as for
lines, cones, and other emitted effects, or may be unrelated except for determining which enemies can be seen
or targeted from a given origin point (as for distant effects that radiate from a chosen central point, but
have a maxRange at which they can deliver that effect).
|
void |
setReach(Reach reach)
Sets the same values as setLimitType(), setMinRange(), setMaxRange(), and setMetric() using one Reach object.
|
void |
shift(Coord aim)
After an AOE has been constructed, it may need to have the affected area shifted over to a different position
without changing any other properties of the AOE.
|
public void shift(Coord aim)
AOE
public boolean mayContainTarget(Set<Coord> targets)
AOE
mayContainTarget
in interface AOE
targets
- a Set of Points that are desirable targets to include in this AOEpublic OrderedMap<Coord,ArrayList<Coord>> idealLocations(Set<Coord> targets, Set<Coord> requiredExclusions)
AOE
idealLocations
in interface AOE
targets
- a Set of Points that are desirable targets to include in this AOErequiredExclusions
- a Set of Points that this tries strongly to avoid including in this AOEpublic OrderedMap<Coord,ArrayList<Coord>> idealLocations(Set<Coord> priorityTargets, Set<Coord> lesserTargets, Set<Coord> requiredExclusions)
AOE
idealLocations
in interface AOE
priorityTargets
- A Set of Points that are the most-wanted targets to include in this AOElesserTargets
- A Set of Points that are the less-wanted targets to include in this AOE, should not overlap with priorityTargetsrequiredExclusions
- a Set of Points that this tries strongly to avoid including in this AOEpublic void setMap(char[][] map)
AOE
public OrderedMap<Coord,Double> findArea()
AOE
public Coord getOrigin()
AOE
public void setOrigin(Coord origin)
AOE
public AimLimit getLimitType()
AOE
getLimitType
in interface AOE
public int getMinRange()
AOE
getMinRange
in interface AOE
public int getMaxRange()
AOE
getMaxRange
in interface AOE
public Radius getMetric()
AOE
public Reach getReach()
public void setLimitType(AimLimit limitType)
AOE
setLimitType
in interface AOE
limitType
- an AimLimit enumpublic void setMinRange(int minRange)
AOE
setMinRange
in interface AOE
public void setMaxRange(int maxRange)
AOE
setMaxRange
in interface AOE
public void setMetric(Radius metric)
AOE
public void setReach(Reach reach)
public void setCache(FOVCache cache)
Copyright © 2012–2016. All rights reserved.