public class PathShape
extends java.awt.geom.Path2D.Float
Modifier and Type | Field and Description |
---|---|
private java.util.List<Position> |
corners |
Constructor and Description |
---|
PathShape(java.util.List<Position> corners)
Create the path shape.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.util.List<Position> positions)
Determines if a point out of a set of points is contained in a shape.
|
boolean |
contains(Position position)
Determines if the shape contains a position.
|
Position |
generatePosition()
Generates a position inside the shape.
|
Position |
generatePosition(RandomPlus randomGenerator)
Generates a position inside the shape.
|
java.util.List<Position> |
generatePositions(int numberOfPositions)
Generates a set of positions inside the shape.
|
java.util.List<Position> |
generatePositions(int numberOfPositions,
RandomPlus randomGenerator)
Generates a set of positions inside the shape.
|
java.util.List<Position> |
getCorners()
Gets the list of corner
Position s. |
boolean |
isCollision(PathShape other)
Determines if this shape intersect with another
PathShape . |
boolean |
isLineCollision(Position start,
Position end)
Determines if a line intersects with the shape.
|
append, clone, curveTo, curveTo, getBounds2D, getPathIterator, lineTo, lineTo, moveTo, moveTo, quadTo, quadTo, transform
append, closePath, contains, contains, contains, contains, contains, contains, contains, contains, createTransformedShape, getBounds, getCurrentPoint, getPathIterator, getWindingRule, intersects, intersects, intersects, intersects, reset, setWindingRule
private final java.util.List<Position> corners
public PathShape(java.util.List<Position> corners)
corners
- The corners.public boolean contains(java.util.List<Position> positions)
positions
- The points.public boolean contains(Position position)
position
- The position.public Position generatePosition()
public Position generatePosition(RandomPlus randomGenerator)
randomGenerator
- The random generator.public java.util.List<Position> generatePositions(int numberOfPositions)
numberOfPositions
- The number of positions we want to generate.public java.util.List<Position> generatePositions(int numberOfPositions, RandomPlus randomGenerator)
numberOfPositions
- The number of positions we want to generate.randomGenerator
- The random generator.public java.util.List<Position> getCorners()
Position
s.public boolean isCollision(PathShape other)
PathShape
.other
- The other shape.