public class ChokePointImpl extends java.lang.Object implements ChokePoint
ChokePoint.Node
Constructor and Description |
---|
ChokePointImpl(Graph graph,
Index index,
Area area1,
Area area2,
java.util.List<WalkPosition> geometry) |
ChokePointImpl(Graph graph,
Index index,
Area area1,
Area area2,
java.util.List<WalkPosition> geometry,
Neutral blockingNeutral) |
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(java.lang.Object o) |
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.
|
java.util.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). |
Index |
getIndex() |
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.
|
ChokePoint |
getPathBackTrace() |
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.
|
void |
onBlockingNeutralDestroyed(Neutral pBlocking) |
void |
setPathBackTrace(ChokePoint pathBackTrace) |
public ChokePointImpl(Graph graph, Index index, Area area1, Area area2, java.util.List<WalkPosition> geometry, Neutral blockingNeutral)
public ChokePointImpl(Graph graph, Index index, Area area1, Area area2, java.util.List<WalkPosition> geometry)
public boolean isPseudo()
ChokePoint
isPseudo
in interface ChokePoint
public Pair<Area,Area> getAreas()
ChokePoint
getAreas
in interface ChokePoint
public WalkPosition getCenter()
ChokePoint
getCenter
in interface ChokePoint
public WalkPosition getNodePosition(ChokePoint.Node node)
ChokePoint
getNodePosition
in interface ChokePoint
public WalkPosition getNodePositionInArea(ChokePoint.Node node, Area area)
ChokePoint
getNodePositionInArea
in interface ChokePoint
public java.util.List<WalkPosition> getGeometry()
ChokePoint
getGeometry
in interface ChokePoint
public boolean isBlocked()
ChokePoint
isBlocked
in interface ChokePoint
public Neutral getBlockingNeutral()
ChokePoint
getBlockingNeutral
in interface ChokePoint
public int distanceFrom(ChokePoint chokePoint)
ChokePoint
distanceFrom
in interface ChokePoint
public boolean accessibleFrom(ChokePoint chokePoint)
ChokePoint
accessibleFrom
in interface ChokePoint
public CPPath getPathTo(ChokePoint cp)
ChokePoint
getPathTo
in interface ChokePoint
public void onBlockingNeutralDestroyed(Neutral pBlocking)
public Index getIndex()
public ChokePoint getPathBackTrace()
public void setPathBackTrace(ChokePoint pathBackTrace)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object