Class PolyShape
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.PolyShape
- All Implemented Interfaces:
IPolyShape
public class PolyShape
extends java.lang.Object
implements IPolyShape
Constructor Summary
Constructors Constructor Description PolyShape()
Instantiates a newPolyShape
instance.PolyShape(IPolyShape original)
Instantiates a newPolyShape
instance by copying from the specified original.Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object anObject)
Tests for equality between two polylines.java.util.List<java.awt.geom.Point2D>
getAbsolutePoints(double x, double y)
java.util.List<java.awt.geom.Point2D>
getAbsolutePoints(java.awt.geom.Point2D origin)
java.util.List<java.awt.geom.Point2D>
getPoints()
Gets all points of a polyline.int
hashCode()
Computes a hash code for this polyline.
Constructor Details
Method Details
getPoints
public java.util.List<java.awt.geom.Point2D> getPoints()Description copied from interface:IPolyShape
Gets all points of a polyline. The points are relative to the x and y coordinate of the parentIMapObject
.To get a
Path2D
object, you should useMap
- Specified by:
getPoints
in interfaceIPolyShape
- Returns:
- A list containing all points of the polyline.
getAbsolutePoints
public java.util.List<java.awt.geom.Point2D> getAbsolutePoints(double x, double y)- Specified by:
getAbsolutePoints
in interfaceIPolyShape
getAbsolutePoints
public java.util.List<java.awt.geom.Point2D> getAbsolutePoints(java.awt.geom.Point2D origin)- Specified by:
getAbsolutePoints
in interfaceIPolyShape
equals
public boolean equals(java.lang.Object anObject)Description copied from interface:IPolyShape
Tests for equality between two polylines. Two polylines are equal if they have the same points.- Specified by:
equals
in interfaceIPolyShape
- Overrides:
equals
in classjava.lang.Object
- Parameters:
anObject
- The polyline to test equality for- Returns:
- Whether the two polylines are equal, or
false
ifanObject
is not a polyline
hashCode
public int hashCode()Description copied from interface:IPolyShape
Computes a hash code for this polyline. A polyline's hash code is equal to the hash code of its points.- Specified by:
hashCode
in interfaceIPolyShape
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code for this polyline