public final class ChokePoint extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ChokePoint.Node
ChokePoint::middle denotes the "middle" MiniTile of Geometry(), while ChokePoint::END_1 and
ChokePoint::END_2 denote its "ends".
|
Modifier and Type | Method and Description |
---|---|
boolean |
accessibleFrom(ChokePoint chokePoint)
Returns whether this ChokePoint is accessible from cp (through a walkable path).
- Note: the relation is symmetric: this->accessibleFrom(cp) == cp->accessibleFrom(this) - Note: if this == cp, returns true. - Time complexity: O(1) |
int |
distanceFrom(ChokePoint chokePoint)
If accessibleFrom(cp) == false, returns -1.
|
boolean |
equals(Object object) |
Pair<Area,Area> |
getAreas()
Returns the two areas of this ChokePoint.
|
Neutral |
getBlockingNeutral()
If !isPseudo(), returns nullptr.
|
WalkPosition |
getCenter()
Returns the center of this ChokePoint.
|
List<WalkPosition> |
getGeometry()
Returns the set of positions that defines the shape of this ChokePoint.
- Note: none of these miniTiles actually belongs to this ChokePoint (a ChokePoint doesn't contain any MiniTile). |
WalkPosition |
getNodePosition(ChokePoint.Node node)
Returns the position of one of the 3 nodes of this ChokePoint (Cf.
|
WalkPosition |
getNodePositionInArea(ChokePoint.Node node,
Area area)
Pretty much the same as pos(n), except that the returned MiniTile position is guaranteed to be
part of pArea.
|
CPPath |
getPathTo(ChokePoint cp)
Returns a list of getChokePoints, which is intended to be the shortest walking path from this
ChokePoint to cp.
|
int |
hashCode() |
boolean |
isBlocked()
If !isPseudo(), returns false.
|
boolean |
isPseudo()
Tells whether this ChokePoint is a pseudo ChokePoint, i.e., it was created on top of a blocking
Neutral.
|
public boolean isPseudo()
public WalkPosition getCenter()
public WalkPosition getNodePosition(ChokePoint.Node node)
public WalkPosition getNodePositionInArea(ChokePoint.Node node, Area area)
public List<WalkPosition> getGeometry()
public boolean isBlocked()
public Neutral getBlockingNeutral()
public int distanceFrom(ChokePoint chokePoint)
public boolean accessibleFrom(ChokePoint chokePoint)
public CPPath getPathTo(ChokePoint cp)
Copyright © 2022. All rights reserved.